mirror of
https://github.com/ziglang/zig.git
synced 2024-12-03 18:38:45 +00:00
31 lines
600 B
Zig
31 lines
600 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "ignore lval with underscore" {
|
|
_ = false;
|
|
}
|
|
|
|
test "ignore lval with underscore (for loop)" {
|
|
for ([_]void{}) |_, i| {
|
|
_ = i;
|
|
for ([_]void{}) |_, j| {
|
|
_ = j;
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
test "ignore lval with underscore (while loop)" {
|
|
while (optionalReturnError()) |_| {
|
|
while (optionalReturnError()) |_| {
|
|
break;
|
|
} else |_| {}
|
|
break;
|
|
} else |_| {}
|
|
}
|
|
|
|
fn optionalReturnError() !?u32 {
|
|
return error.optionalReturnError;
|
|
}
|