| ... | @@ -175,7 +175,7 @@ test "expectEqual.union(enum)" { | ... | @@ -175,7 +175,7 @@ test "expectEqual.union(enum)" { |
| 175 | /// within the margin of the expected value, | 175 | /// within the margin of the expected value, |
| 176 | /// prints diagnostics to stderr to show exactly how they are not equal, then aborts. | 176 | /// prints diagnostics to stderr to show exactly how they are not equal, then aborts. |
| 177 | /// The types must be floating point | 177 | /// The types must be floating point |
| 178 | pub fn expectWithinMargin(expected: var, actual: @TypeOf(expected), margin: @TypeOf(expected)) void { | 178 | pub fn expectWithinMargin(expected: anytype, actual: @TypeOf(expected), margin: @TypeOf(expected)) void { |
| 179 | std.debug.assert(margin >= 0.0); | 179 | std.debug.assert(margin >= 0.0); |
| 180 | | 180 | |
| 181 | switch (@typeInfo(@TypeOf(actual))) { | 181 | switch (@typeInfo(@TypeOf(actual))) { |
| ... | @@ -201,7 +201,7 @@ test "expectWithinMargin.f32" { | ... | @@ -201,7 +201,7 @@ test "expectWithinMargin.f32" { |
| 201 | /// within the epsilon of the expected value, | 201 | /// within the epsilon of the expected value, |
| 202 | /// prints diagnostics to stderr to show exactly how they are not equal, then aborts. | 202 | /// prints diagnostics to stderr to show exactly how they are not equal, then aborts. |
| 203 | /// The types must be floating point | 203 | /// The types must be floating point |
| 204 | pub fn expectWithinEpsilon(expected: var, actual: @TypeOf(expected), epsilon: @TypeOf(expected)) void { | 204 | pub fn expectWithinEpsilon(expected: anytype, actual: @TypeOf(expected), epsilon: @TypeOf(expected)) void { |
| 205 | std.debug.assert(epsilon >= 0.0 and epsilon <= 1.0); | 205 | std.debug.assert(epsilon >= 0.0 and epsilon <= 1.0); |
| 206 | | 206 | |
| 207 | const margin = epsilon * expected; | 207 | const margin = epsilon * expected; |