mirror of
https://github.com/ziglang/zig.git
synced 2026-02-13 21:08:36 +00:00
test: add a behavior test for 0-length loop fix
This commit is contained in:
parent
ae442e2c29
commit
22013f1b39
@ -535,3 +535,12 @@ test "return from inline for" {
|
||||
};
|
||||
try std.testing.expect(!S.do());
|
||||
}
|
||||
|
||||
test "for loop 0 length range" {
|
||||
const map: []const u8 = &.{};
|
||||
for (map, 0..map.len) |i, j| {
|
||||
_ = i;
|
||||
_ = j;
|
||||
comptime unreachable;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user