| 1 | #exe { |
| 2 | -Mroot=main.zig |
| 3 | #} |
| 4 | |
| 5 | #write main.zig { |
| 6 | const std = @import("std"); |
| 7 | pub fn main() !void { |
| 8 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); |
| 9 | } |
| 10 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 11 | #} |
| 12 | #update "no compile log" |
| 13 | #check stdout { |
| 14 | Hello, World! |
| 15 | #} |
| 16 | |
| 17 | #write main.zig { |
| 18 | const std = @import("std"); |
| 19 | pub fn main() !void { |
| 20 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); |
| 21 | @compileLog("this is a log"); |
| 22 | } |
| 23 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 24 | #} |
| 25 | #update "add compile log" |
| 26 | #check errors { |
| 27 | main.zig:4:5: error: found compile log statement |
| 28 | |
| 29 | Compile Log Output: |
| 30 | @as(*const [13:0]u8, "this is a log") |
| 31 | #} |
| 32 | |
| 33 | #write main.zig { |
| 34 | const std = @import("std"); |
| 35 | pub fn main() !void { |
| 36 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); |
| 37 | } |
| 38 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 39 | #} |
| 40 | #update "remove compile log" |
| 41 | #check stdout { |
| 42 | Hello, World! |
| 43 | #} |