aboutsummaryrefslogtreecommitdiff
path: root/test/behavior/switch.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/behavior/switch.zig')
-rw-r--r--test/behavior/switch.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/behavior/switch.zig b/test/behavior/switch.zig
index b518766d97..4ab6362a49 100644
--- a/test/behavior/switch.zig
+++ b/test/behavior/switch.zig
@@ -1056,3 +1056,12 @@ test "unlabeled break ignores switch" {
};
try expect(result == 123);
}
+
+test "switch on a signed value smaller than the smallest prong value" {
+ var v: i32 = undefined;
+ v = -1;
+ switch (v) {
+ inline 0...10 => return error.TestFailed,
+ else => {},
+ }
+}