| ... | @@ -0,0 +1,46 @@ |
| 1 | #target=x86_64-linux-selfhosted |
| 2 | #target=x86_64-linux-cbe |
| 3 | #target=x86_64-windows-cbe |
| 4 | //#target=wasm32-wasi-selfhosted |
| 5 | #update=initial version |
| 6 | #file=main.zig |
| 7 | const std = @import("std"); |
| 8 | const message: []const u8 = @import("message.zon"); |
| 9 | pub fn main() !void { |
| 10 | try std.io.getStdOut().writeAll(message); |
| 11 | } |
| 12 | #file=message.zon |
| 13 | "Hello, World!\n" |
| 14 | #expect_stdout="Hello, World!\n" |
| 15 | |
| 16 | #update=change ZON file contents |
| 17 | #file=message.zon |
| 18 | "Hello again, World!\n" |
| 19 | #expect_stdout="Hello again, World!\n" |
| 20 | |
| 21 | #update=delete file |
| 22 | #rm_file=message.zon |
| 23 | #expect_error=message.zon:1:1: error: unable to load './message.zon': FileNotFound |
| 24 | |
| 25 | #update=remove reference to ZON file |
| 26 | #file=main.zig |
| 27 | const std = @import("std"); |
| 28 | const message: []const u8 = @import("message.zon"); |
| 29 | pub fn main() !void { |
| 30 | try std.io.getStdOut().writeAll("a hardcoded string\n"); |
| 31 | } |
| 32 | #expect_error=message.zon:1:1: error: unable to load './message.zon': FileNotFound |
| 33 | |
| 34 | #update=recreate ZON file |
| 35 | #file=message.zon |
| 36 | "We're back, World!\n" |
| 37 | #expect_stdout="a hardcoded string\n" |
| 38 | |
| 39 | #update=re-introduce reference to ZON file |
| 40 | #file=main.zig |
| 41 | const std = @import("std"); |
| 42 | const message: []const u8 = @import("message.zon"); |
| 43 | pub fn main() !void { |
| 44 | try std.io.getStdOut().writeAll(message); |
| 45 | } |
| 46 | #expect_stdout="We're back, World!\n" |