Skip to content

Commit fe6cc0c

Browse files
LemonBoyVexu
authored andcommitted
std: Better handling of type values in expectEqual
1 parent 81f5e1e commit fe6cc0c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/std/testing.zig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ pub fn expectEqual(expected: anytype, actual: @TypeOf(expected)) void {
5353
.Void,
5454
=> return,
5555

56-
.Type,
56+
.Type => {
57+
if (actual != expected) {
58+
std.debug.panic("expected type {}, found type {}", .{ @typeName(expected), @typeName(actual) });
59+
}
60+
},
61+
5762
.Bool,
5863
.Int,
5964
.Float,

0 commit comments

Comments
 (0)