|
| 1 | +#target=x86_64-linux-selfhosted |
| 2 | +#target=x86_64-windows-selfhosted |
| 3 | +#target=x86_64-linux-cbe |
| 4 | +#target=x86_64-windows-cbe |
| 5 | +//#target=wasm32-wasi-selfhosted |
| 6 | +#update=initial version |
| 7 | +#file=main.zig |
| 8 | +const std = @import("std"); |
| 9 | +pub fn main() !void { |
| 10 | + try std.fs.File.stdout().writeAll(foo); |
| 11 | +} |
| 12 | +const foo = "good morning\n"; |
| 13 | +#expect_stdout="good morning\n" |
| 14 | + |
| 15 | +#update=add new declaration |
| 16 | +#file=main.zig |
| 17 | +const std = @import("std"); |
| 18 | +pub fn main() !void { |
| 19 | + try std.fs.File.stdout().writeAll(foo); |
| 20 | +} |
| 21 | +const foo = "good morning\n"; |
| 22 | +const bar = "good evening\n"; |
| 23 | +#expect_stdout="good morning\n" |
| 24 | + |
| 25 | +#update=reference new declaration |
| 26 | +#file=main.zig |
| 27 | +const std = @import("std"); |
| 28 | +pub fn main() !void { |
| 29 | + try std.fs.File.stdout().writeAll(bar); |
| 30 | +} |
| 31 | +const foo = "good morning\n"; |
| 32 | +const bar = "good evening\n"; |
| 33 | +#expect_stdout="good evening\n" |
| 34 | + |
| 35 | +#update=reference missing declaration |
| 36 | +#file=main.zig |
| 37 | +const std = @import("std"); |
| 38 | +pub fn main() !void { |
| 39 | + try std.fs.File.stdout().writeAll(qux); |
| 40 | +} |
| 41 | +const foo = "good morning\n"; |
| 42 | +const bar = "good evening\n"; |
| 43 | +#expect_error=main.zig:3:39: error: use of undeclared identifier 'qux' |
| 44 | + |
| 45 | +#update=add missing declaration |
| 46 | +#file=main.zig |
| 47 | +const std = @import("std"); |
| 48 | +pub fn main() !void { |
| 49 | + try std.fs.File.stdout().writeAll(qux); |
| 50 | +} |
| 51 | +const foo = "good morning\n"; |
| 52 | +const bar = "good evening\n"; |
| 53 | +const qux = "good night\n"; |
| 54 | +#expect_stdout="good night\n" |
| 55 | + |
| 56 | +#update=remove unused declarations |
| 57 | +#file=main.zig |
| 58 | +const std = @import("std"); |
| 59 | +pub fn main() !void { |
| 60 | + try std.fs.File.stdout().writeAll(qux); |
| 61 | +} |
| 62 | +const qux = "good night\n"; |
| 63 | +#expect_stdout="good night\n" |
0 commit comments