mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
28 lines
475 B
Zig
28 lines
475 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "nested break" {
|
|
var count: usize = 0;
|
|
outer: for (1..6) |_| {
|
|
for (1..6) |_| {
|
|
count += 1;
|
|
break :outer;
|
|
}
|
|
}
|
|
try expect(count == 1);
|
|
}
|
|
|
|
test "nested continue" {
|
|
var count: usize = 0;
|
|
outer: for (1..9) |_| {
|
|
for (1..6) |_| {
|
|
count += 1;
|
|
continue :outer;
|
|
}
|
|
}
|
|
|
|
try expect(count == 8);
|
|
}
|
|
|
|
// test
|