| 1 | #exe { |
| 2 | -Mroot=main.zig |
| 3 | #} |
| 4 | |
| 5 | #write main.zig { |
| 6 | const std = @import("std"); |
| 7 | pub fn main() !void { |
| 8 | const str = getStr(); |
| 9 | try std.Io.File.stdout().writeStreamingAll(io, str); |
| 10 | } |
| 11 | inline fn getStr() []const u8 { |
| 12 | return "foo\n"; |
| 13 | } |
| 14 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 15 | #} |
| 16 | #update |
| 17 | #check stdout { |
| 18 | foo |
| 19 | #} |
| 20 | |
| 21 | #write main.zig { |
| 22 | const std = @import("std"); |
| 23 | pub fn main() !void { |
| 24 | const str = getStr(); |
| 25 | try std.Io.File.stdout().writeStreamingAll(io, str); |
| 26 | } |
| 27 | inline fn getStr() []const u8 { |
| 28 | return "bar\n"; |
| 29 | } |
| 30 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 31 | #} |
| 32 | #update "change the string" |
| 33 | #check stdout { |
| 34 | bar |
| 35 | #} |