authorgravatar for r00ster91@proton.meWooster <r00ster91@proton.me> 2022-09-29 09:43:22+02:00
committergravatar for luuk@degram.devLuuk de Gram <luuk@degram.dev> 2022-09-29 21:40:25+02:00
logf6312e4b6933b8c8d163d6e6b20da135c5fa986a
treeb0d4b840557325af442ff0f68f33ffbc565dd13a
parentfda0b2c372c3e9ecc348a9cc4afc4e7afd966427

docs: minor improvements

Just some minor improvements when passing by.

1 files changed, 5 insertions(+), 5 deletions(-)

lib/std/testing.zig+5-5
...@@ -214,7 +214,7 @@ pub fn expectFmt(expected: []const u8, comptime template: []const u8, args: anyt...@@ -214,7 +214,7 @@ pub fn expectFmt(expected: []const u8, comptime template: []const u8, args: anyt
214/// not approximately equal to the expected value, prints diagnostics to stderr214/// not approximately equal to the expected value, prints diagnostics to stderr
215/// to show exactly how they are not equal, then returns a test failure error.215/// to show exactly how they are not equal, then returns a test failure error.
216/// See `math.approxEqAbs` for more informations on the tolerance parameter.216/// See `math.approxEqAbs` for more informations on the tolerance parameter.
217/// The types must be floating point217/// The types must be floating point.
218pub fn expectApproxEqAbs(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void {218pub fn expectApproxEqAbs(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void {
219 const T = @TypeOf(expected);219 const T = @TypeOf(expected);
220220
...@@ -246,7 +246,7 @@ test "expectApproxEqAbs" {...@@ -246,7 +246,7 @@ test "expectApproxEqAbs" {
246/// not approximately equal to the expected value, prints diagnostics to stderr246/// not approximately equal to the expected value, prints diagnostics to stderr
247/// to show exactly how they are not equal, then returns a test failure error.247/// to show exactly how they are not equal, then returns a test failure error.
248/// See `math.approxEqRel` for more informations on the tolerance parameter.248/// See `math.approxEqRel` for more informations on the tolerance parameter.
249/// The types must be floating point249/// The types must be floating point.
250pub fn expectApproxEqRel(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void {250pub fn expectApproxEqRel(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void {
251 const T = @TypeOf(expected);251 const T = @TypeOf(expected);
252252
...@@ -719,7 +719,7 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime...@@ -719,7 +719,7 @@ pub fn checkAllAllocationFailures(backing_allocator: std.mem.Allocator, comptime
719 }719 }
720}720}
721721
722/// Given a type, reference all the declarations inside, so that the semantic analyzer sees them.722/// Given a type, references all the declarations inside, so that the semantic analyzer sees them.
723pub fn refAllDecls(comptime T: type) void {723pub fn refAllDecls(comptime T: type) void {
724 if (!builtin.is_test) return;724 if (!builtin.is_test) return;
725 inline for (comptime std.meta.declarations(T)) |decl| {725 inline for (comptime std.meta.declarations(T)) |decl| {
...@@ -727,8 +727,8 @@ pub fn refAllDecls(comptime T: type) void {...@@ -727,8 +727,8 @@ pub fn refAllDecls(comptime T: type) void {
727 }727 }
728}728}
729729
730/// Given a type, and Recursively reference all the declarations inside, so that the semantic analyzer sees them.730/// Given a type, recursively references all the declarations inside, so that the semantic analyzer sees them.
731/// For deep types, you may use `@setEvalBranchQuota`731/// For deep types, you may use `@setEvalBranchQuota`.
732pub fn refAllDeclsRecursive(comptime T: type) void {732pub fn refAllDeclsRecursive(comptime T: type) void {
733 if (!builtin.is_test) return;733 if (!builtin.is_test) return;
734 inline for (comptime std.meta.declarations(T)) |decl| {734 inline for (comptime std.meta.declarations(T)) |decl| {