mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-03-08 03:04:52 +01:00
40 lines
1.3 KiB
Text
40 lines
1.3 KiB
Text
#target=x86_64-linux-selfhosted
|
|
#target=x86_64-windows-selfhosted
|
|
#target=x86_64-linux-cbe
|
|
#target=x86_64-windows-cbe
|
|
#target=wasm32-wasi-selfhosted
|
|
#update=initial version with error
|
|
#file=main.zig
|
|
pub fn main() !void {
|
|
try @import("foo.zig").hello();
|
|
}
|
|
#file=foo.zig
|
|
pub fn hello() !void {
|
|
try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n");
|
|
}
|
|
#expect_error=foo.zig:2:9: error: use of undeclared identifier 'std'
|
|
#update=fix the error
|
|
#file=foo.zig
|
|
const std = @import("std");
|
|
pub fn hello() !void {
|
|
try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n");
|
|
}
|
|
const io = std.Io.Threaded.global_single_threaded.ioBasic();
|
|
#expect_stdout="Hello, World!\n"
|
|
#update=add new error
|
|
#file=foo.zig
|
|
const std = @import("std");
|
|
pub fn hello() !void {
|
|
try std.Io.File.stdout().writeStreamingAll(io, hello_str);
|
|
}
|
|
const io = std.Io.Threaded.global_single_threaded.ioBasic();
|
|
#expect_error=foo.zig:3:52: error: use of undeclared identifier 'hello_str'
|
|
#update=fix the new error
|
|
#file=foo.zig
|
|
const std = @import("std");
|
|
const hello_str = "Hello, World! Again!\n";
|
|
pub fn hello() !void {
|
|
try std.Io.File.stdout().writeStreamingAll(io, hello_str);
|
|
}
|
|
const io = std.Io.Threaded.global_single_threaded.ioBasic();
|
|
#expect_stdout="Hello, World! Again!\n"
|