add test cases to cover switching on u0 values

closes #1563
This commit is contained in:
Andrew Kelley 2019-03-11 19:42:07 -04:00
parent 1a94dec50e
commit 761356209b
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -269,3 +269,17 @@ fn testSwitchOnBoolsFalseWithElse(x: bool) bool {
else => false,
};
}
test "u0" {
var val: u0 = 0;
switch (val) {
0 => expect(val == 0),
}
}
test "undefined.u0" {
var val: u0 = undefined;
switch (val) {
0 => expect(val == 0),
}
}