zig/test/behavior/underscore.zig

23 lines
514 B
Zig
Raw Normal View History

const std = @import("std");
2022-02-22 13:15:09 +00:00
const builtin = @import("builtin");
const expect = std.testing.expect;
test "ignore lval with underscore" {
_ = false;
}
test "ignore lval with underscore (while loop)" {
2022-02-22 13:15:09 +00:00
if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest;
while (optionalReturnError()) |_| {
while (optionalReturnError()) |_| {
break;
} else |_| {}
break;
} else |_| {}
}
fn optionalReturnError() !?u32 {
return error.optionalReturnError;
}