diff options
| -rw-r--r-- | std/testing.zig | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/std/testing.zig b/std/testing.zig index ade6e8b0dd..bece76ee5c 100644 --- a/std/testing.zig +++ b/std/testing.zig @@ -24,11 +24,7 @@ pub fn expectError(expected_error: anyerror, actual_error_union: var) void { /// equal, prints diagnostics to stderr to show exactly how they are not equal, /// then aborts. /// The types must match exactly. -pub fn expectEqual(expected: var, actual: var) void { - if (@typeOf(actual) != @typeOf(expected)) { - @compileError("type mismatch. expected " ++ @typeName(@typeOf(expected)) ++ ", found " ++ @typeName(@typeOf(actual))); - } - +pub fn expectEqual(expected: var, actual: @typeOf(expected)) void { switch (@typeInfo(@typeOf(actual))) { TypeId.NoReturn, TypeId.BoundFn, |
