zig/test/incremental/fix_astgen_failure
2024-10-18 09:46:03 +01:00

37 lines
923 B
Plaintext

// Disabled on self-hosted due to linker crash
// #target=x86_64-linux-selfhosted
#target=x86_64-linux-cbe
#target=x86_64-windows-cbe
#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.getStdOut().writeAll("Hello, World!\n");
}
#expect_error=ignored
#update=fix the error
#file=foo.zig
const std = @import("std");
pub fn hello() !void {
try std.io.getStdOut().writeAll("Hello, World!\n");
}
#expect_stdout="Hello, World!\n"
#update=add new error
#file=foo.zig
const std = @import("std");
pub fn hello() !void {
try std.io.getStdOut().writeAll(hello_str);
}
#expect_error=ignored
#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.getStdOut().writeAll(hello_str);
}
#expect_stdout="Hello, World! Again!\n"