diff options
| author | LemonBoy <thatlemon@gmail.com> | 2020-10-29 11:10:21 +0100 |
|---|---|---|
| committer | LemonBoy <thatlemon@gmail.com> | 2020-10-29 11:10:21 +0100 |
| commit | 88eb3ae8e5ff5aa53ff197ca3e008502b043936f (patch) | |
| tree | 2f8ff4772bd3857b7a0ed4a12c1e903000a424c5 | |
| parent | 7bc95316982da0da6fd5d935645972fe5464e46e (diff) | |
| download | zig-88eb3ae8e5ff5aa53ff197ca3e008502b043936f.tar.gz zig-88eb3ae8e5ff5aa53ff197ca3e008502b043936f.zip | |
std: Better handling of type values in expectEqual
| -rw-r--r-- | lib/std/testing.zig | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/std/testing.zig b/lib/std/testing.zig index 4b388adb67..5f2cb112bb 100644 --- a/lib/std/testing.zig +++ b/lib/std/testing.zig @@ -53,7 +53,12 @@ pub fn expectEqual(expected: anytype, actual: @TypeOf(expected)) void { .Void, => return, - .Type, + .Type => { + if (actual != expected) { + std.debug.panic("expected type {}, found type {}", .{ @typeName(expected), @typeName(actual) }); + } + }, + .Bool, .Int, .Float, |
