mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
16 lines
269 B
Zig
16 lines
269 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "labeled break from labeled block expression" {
|
|
var y: i32 = 123;
|
|
|
|
const x = blk: {
|
|
y += 1;
|
|
break :blk y;
|
|
};
|
|
try expect(x == 124);
|
|
try expect(y == 124);
|
|
}
|
|
|
|
// test
|