zig/doc/langref/test_while_continue.zig

15 lines
227 B
Zig
Raw Normal View History

const expect = @import("std").testing.expect;
test "while continue" {
var i: usize = 0;
while (true) {
i += 1;
if (i < 10)
continue;
break;
}
try expect(i == 10);
}
// test