1#exe {
2-Mroot=main.zig
3#}
4
5#write main.zig {
6pub fn main() !void {
7 try @import("foo.zig").hello();
8}
9#}
10#write foo.zig {
11pub fn hello() !void {
12 try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n");
13}
14#}
15#update "error"
16#check errors {
17foo.zig:2:9: error: use of undeclared identifier 'std'
18#}
19
20#write foo.zig {
21const std = @import("std");
22pub fn hello() !void {
23 try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n");
24}
25const io = std.Io.Threaded.global_single_threaded.io();
26#}
27#update "fix the error"
28#check stdout {
29Hello, World!
30#}
31
32#write foo.zig {
33const std = @import("std");
34pub fn hello() !void {
35 try std.Io.File.stdout().writeStreamingAll(io, hello_str);
36}
37const io = std.Io.Threaded.global_single_threaded.io();
38#}
39#update "add new error"
40#check errors {
41foo.zig:3:52: error: use of undeclared identifier 'hello_str'
42#}
43
44#write foo.zig {
45const std = @import("std");
46const hello_str = "Hello, World! Again!\n";
47pub fn hello() !void {
48 try std.Io.File.stdout().writeStreamingAll(io, hello_str);
49}
50const io = std.Io.Threaded.global_single_threaded.io();
51#}
52#update "fix the new error"
53#check stdout {
54Hello, World! Again!
55#}