authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-02-04 15:13:06+00:00
committergravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-02-04 16:20:30+00:00
logd60910c9d0fa4d28a4f738e95357ddada84ae106
tree8847605f5441a7859d22c1cb33415995f23aa961
parentfb481d0bf81df7b0ce9afde5cd615133d9895726
signaturelock-open Commit is signed but in an unrecognized format.

incremental: add ZON test


1 files changed, 46 insertions(+), 0 deletions(-)

test/incremental/change_zon_file created+46
......@@ -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
7const std = @import("std");
8const message: []const u8 = @import("message.zon");
9pub 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
27const std = @import("std");
28const message: []const u8 = @import("message.zon");
29pub 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
41const std = @import("std");
42const message: []const u8 = @import("message.zon");
43pub fn main() !void {
44 try std.io.getStdOut().writeAll(message);
45}
46#expect_stdout="We're back, World!\n"