| 1 | #update=initial version |
| 2 | #file=main.zig |
| 3 | const std = @import("std"); |
| 4 | pub fn main() !void { |
| 5 | try std.Io.File.stdout().writeStreamingAll(io, a); |
| 6 | } |
| 7 | const a = "Hello, World!\n"; |
| 8 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 9 | #expect_stdout="Hello, World!\n" |
| 10 | |
| 11 | #update=introduce compile error |
| 12 | #file=main.zig |
| 13 | const std = @import("std"); |
| 14 | pub fn main() !void { |
| 15 | try std.Io.File.stdout().writeStreamingAll(io, a); |
| 16 | } |
| 17 | const a = @compileError("bad a"); |
| 18 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 19 | #expect_error=main.zig:5:11: error: bad a |
| 20 | |
| 21 | #update=remove error reference |
| 22 | #file=main.zig |
| 23 | const std = @import("std"); |
| 24 | pub fn main() !void { |
| 25 | try std.Io.File.stdout().writeStreamingAll(io, b); |
| 26 | } |
| 27 | const a = @compileError("bad a"); |
| 28 | const b = "Hi there!\n"; |
| 29 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 30 | #expect_stdout="Hi there!\n" |
| 31 | |
| 32 | #update=introduce and remove reference to error |
| 33 | #file=main.zig |
| 34 | const std = @import("std"); |
| 35 | pub fn main() !void { |
| 36 | try std.Io.File.stdout().writeStreamingAll(io, a); |
| 37 | } |
| 38 | const a = "Back to a\n"; |
| 39 | const b = @compileError("bad b"); |
| 40 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 41 | #expect_stdout="Back to a\n" |