zig/test/incremental/unreferenced_error
Andrew Kelley debf307594 update all incremental tests to new std API
they're still not passing on windows for some reason though
2025-12-23 22:15:11 -08:00

46 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
#file=main.zig
const std = @import("std");
pub fn main() !void {
try std.Io.File.stdout().writeStreamingAll(io, a);
}
const a = "Hello, World!\n";
const io = std.Io.Threaded.global_single_threaded.ioBasic();
#expect_stdout="Hello, World!\n"
#update=introduce compile error
#file=main.zig
const std = @import("std");
pub fn main() !void {
try std.Io.File.stdout().writeStreamingAll(io, a);
}
const a = @compileError("bad a");
const io = std.Io.Threaded.global_single_threaded.ioBasic();
#expect_error=main.zig:5:11: error: bad a
#update=remove error reference
#file=main.zig
const std = @import("std");
pub fn main() !void {
try std.Io.File.stdout().writeStreamingAll(io, b);
}
const a = @compileError("bad a");
const b = "Hi there!\n";
const io = std.Io.Threaded.global_single_threaded.ioBasic();
#expect_stdout="Hi there!\n"
#update=introduce and remove reference to error
#file=main.zig
const std = @import("std");
pub fn main() !void {
try std.Io.File.stdout().writeStreamingAll(io, a);
}
const a = "Back to a\n";
const b = @compileError("bad b");
const io = std.Io.Threaded.global_single_threaded.ioBasic();
#expect_stdout="Back to a\n"