zig/doc/langref/test_while.zig

12 lines
169 B
Zig

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