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