| 1 | #update=initial version with error |
| 2 | #file=main.zig |
| 3 | pub fn main() !void { |
| 4 | try @import("foo.zig").hello(); |
| 5 | } |
| 6 | #file=foo.zig |
| 7 | pub 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 |
| 13 | const std = @import("std"); |
| 14 | pub fn hello() !void { |
| 15 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); |
| 16 | } |
| 17 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 18 | #expect_stdout="Hello, World!\n" |
| 19 | #update=add new error |
| 20 | #file=foo.zig |
| 21 | const std = @import("std"); |
| 22 | pub fn hello() !void { |
| 23 | try std.Io.File.stdout().writeStreamingAll(io, hello_str); |
| 24 | } |
| 25 | const 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 |
| 29 | const std = @import("std"); |
| 30 | const hello_str = "Hello, World! Again!\n"; |
| 31 | pub fn hello() !void { |
| 32 | try std.Io.File.stdout().writeStreamingAll(io, hello_str); |
| 33 | } |
| 34 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 35 | #expect_stdout="Hello, World! Again!\n" |