| 1 | const std = @import("std"); |
| 2 | const expectEqual = std.testing.expectEqual; |
| 3 | |
| 4 | test "labeled break from labeled block expression" { |
| 5 | var y: i32 = 123; |
| 6 | |
| 7 | const x = blk: { |
| 8 | y += 1; |
| 9 | break :blk y; |
| 10 | }; |
| 11 | try expectEqual(124, x); |
| 12 | try expectEqual(124, y); |
| 13 | } |
| 14 | |
| 15 | // test |