Commit 88eb3ae8e5

LemonBoy <thatlemon@gmail.com>
2020-10-29 11:10:21
std: Better handling of type values in expectEqual
1 parent 7bc9531
Changed files (1)
lib
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,