| ... | @@ -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 stderr | 214 | /// 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 point | 217 | /// The types must be floating point. |
| 218 | pub fn expectApproxEqAbs(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void { | 218 | pub fn expectApproxEqAbs(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void { |
| 219 | const T = @TypeOf(expected); | 219 | const T = @TypeOf(expected); |
| 220 | | 220 | |
| ... | @@ -246,7 +246,7 @@ test "expectApproxEqAbs" { | ... | @@ -246,7 +246,7 @@ test "expectApproxEqAbs" { |
| 246 | /// not approximately equal to the expected value, prints diagnostics to stderr | 246 | /// 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 point | 249 | /// The types must be floating point. |
| 250 | pub fn expectApproxEqRel(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void { | 250 | pub fn expectApproxEqRel(expected: anytype, actual: @TypeOf(expected), tolerance: @TypeOf(expected)) !void { |
| 251 | const T = @TypeOf(expected); | 251 | const T = @TypeOf(expected); |
| 252 | | 252 | |
| ... | @@ -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 | } |
| 721 | | 721 | |
| 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. |
| 723 | pub fn refAllDecls(comptime T: type) void { | 723 | pub 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 | } |
| 729 | | 729 | |
| 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`. |
| 732 | pub fn refAllDeclsRecursive(comptime T: type) void { | 732 | pub 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| { |