aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-10-29 11:10:21 +0100
committerLemonBoy <thatlemon@gmail.com>2020-10-29 11:10:21 +0100
commit88eb3ae8e5ff5aa53ff197ca3e008502b043936f (patch)
tree2f8ff4772bd3857b7a0ed4a12c1e903000a424c5
parent7bc95316982da0da6fd5d935645972fe5464e46e (diff)
downloadzig-88eb3ae8e5ff5aa53ff197ca3e008502b043936f.tar.gz
zig-88eb3ae8e5ff5aa53ff197ca3e008502b043936f.zip
std: Better handling of type values in expectEqual
-rw-r--r--lib/std/testing.zig7
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,