commit fe6cc0c3ba6eee1ad17c2b1816847fd9c324e01b (tree)
parent 81f5e1e66756096b101f9e30e7f41a24eeaa79c5
Author: LemonBoy <thatlemon@gmail.com>
Date: Thu, 29 Oct 2020 11:10:21 +0100
std: Better handling of type values in expectEqual
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git 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,