| 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, @This().foo); |
| 9 | } |
| 10 | const foo = "good morning\n"; |
| 11 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 12 | #} |
| 13 | #update |
| 14 | #check stdout { |
| 15 | good morning |
| 16 | #} |
| 17 | |
| 18 | #write main.zig { |
| 19 | const std = @import("std"); |
| 20 | pub fn main() !void { |
| 21 | try std.Io.File.stdout().writeStreamingAll(io, @This().foo); |
| 22 | } |
| 23 | const foo = "good morning\n"; |
| 24 | const bar = "good evening\n"; |
| 25 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 26 | #} |
| 27 | #update "add new declaration" |
| 28 | #check stdout { |
| 29 | good morning |
| 30 | #} |
| 31 | |
| 32 | #write main.zig { |
| 33 | const std = @import("std"); |
| 34 | pub fn main() !void { |
| 35 | try std.Io.File.stdout().writeStreamingAll(io, @This().bar); |
| 36 | } |
| 37 | const foo = "good morning\n"; |
| 38 | const bar = "good evening\n"; |
| 39 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 40 | #} |
| 41 | #update "reference new declaration" |
| 42 | #check stdout { |
| 43 | good evening |
| 44 | #} |
| 45 | |
| 46 | #write main.zig { |
| 47 | const std = @import("std"); |
| 48 | pub fn main() !void { |
| 49 | try std.Io.File.stdout().writeStreamingAll(io, @This().qux); |
| 50 | } |
| 51 | const foo = "good morning\n"; |
| 52 | const bar = "good evening\n"; |
| 53 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 54 | #} |
| 55 | #update "reference missing declaration" |
| 56 | #check errors { |
| 57 | main.zig:3:59: error: root source file struct 'main' has no member named 'qux' |
| 58 | main.zig:1:1: note: struct declared here |
| 59 | #} |
| 60 | |
| 61 | #write main.zig { |
| 62 | const std = @import("std"); |
| 63 | pub fn main() !void { |
| 64 | try std.Io.File.stdout().writeStreamingAll(io, @This().qux); |
| 65 | } |
| 66 | const foo = "good morning\n"; |
| 67 | const bar = "good evening\n"; |
| 68 | const qux = "good night\n"; |
| 69 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 70 | #} |
| 71 | #update "add missing declaration" |
| 72 | #check stdout { |
| 73 | good night |
| 74 | #} |
| 75 | |
| 76 | #write main.zig { |
| 77 | const std = @import("std"); |
| 78 | pub fn main() !void { |
| 79 | try std.Io.File.stdout().writeStreamingAll(io, @This().qux); |
| 80 | } |
| 81 | const qux = "good night\n"; |
| 82 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 83 | #} |
| 84 | #update "remove unused declarations" |
| 85 | #check stdout { |
| 86 | good night |
| 87 | #} |