1#update=initial version with error
2#file=main.zig
3pub fn main() !void {
4 try @import("foo.zig").hello();
5}
6#file=foo.zig
7pub fn hello() !void {
8 try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n");
9}
10#expect_error=foo.zig:2:9: error: use of undeclared identifier 'std'
11#update=fix the error
12#file=foo.zig
13const std = @import("std");
14pub fn hello() !void {
15 try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n");
16}
17const io = std.Io.Threaded.global_single_threaded.io();
18#expect_stdout="Hello, World!\n"
19#update=add new error
20#file=foo.zig
21const std = @import("std");
22pub fn hello() !void {
23 try std.Io.File.stdout().writeStreamingAll(io, hello_str);
24}
25const io = std.Io.Threaded.global_single_threaded.io();
26#expect_error=foo.zig:3:52: error: use of undeclared identifier 'hello_str'
27#update=fix the new error
28#file=foo.zig
29const std = @import("std");
30const hello_str = "Hello, World! Again!\n";
31pub fn hello() !void {
32 try std.Io.File.stdout().writeStreamingAll(io, hello_str);
33}
34const io = std.Io.Threaded.global_single_threaded.io();
35#expect_stdout="Hello, World! Again!\n"