mirror of
https://github.com/ziglang/zig.git
synced 2025-12-12 17:23:09 +00:00
Companion commit to 61a53a587558ff1fe1b0ec98bb424022885edccf. This commit also moves over a bunch of behavior test cases to the passing-for-stage2 section.
20 lines
403 B
Zig
20 lines
403 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "ignore lval with underscore" {
|
|
_ = false;
|
|
}
|
|
|
|
test "ignore lval with underscore (while loop)" {
|
|
while (optionalReturnError()) |_| {
|
|
while (optionalReturnError()) |_| {
|
|
break;
|
|
} else |_| {}
|
|
break;
|
|
} else |_| {}
|
|
}
|
|
|
|
fn optionalReturnError() !?u32 {
|
|
return error.optionalReturnError;
|
|
}
|