| author | |
| committer | |
| log | debf3075942a0a8aa4078ffefc2f1201dd92d72b |
| tree | 51d16aa7b96f1d3989e85ecbfb737e2650bb0c0f |
| parent | 77d2ad8c929680ed35fcfe6646f940518a07e7e4 |
they're still not passing on windows for some reason though26 files changed, 155 insertions(+), 80 deletions(-)
test/incremental/add_decl+13-7| ... | ... | @@ -7,57 +7,63 @@ |
| 7 | 7 | #file=main.zig |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | pub fn main() !void { |
| 10 | try std.Io.File.stdout().writeAll(foo); | |
| 10 | try std.Io.File.stdout().writeStreamingAll(io, foo); | |
| 11 | 11 | } |
| 12 | 12 | const foo = "good morning\n"; |
| 13 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 13 | 14 | #expect_stdout="good morning\n" |
| 14 | 15 | |
| 15 | 16 | #update=add new declaration |
| 16 | 17 | #file=main.zig |
| 17 | 18 | const std = @import("std"); |
| 18 | 19 | pub fn main() !void { |
| 19 | try std.Io.File.stdout().writeAll(foo); | |
| 20 | try std.Io.File.stdout().writeStreamingAll(io, foo); | |
| 20 | 21 | } |
| 21 | 22 | const foo = "good morning\n"; |
| 22 | 23 | const bar = "good evening\n"; |
| 24 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 23 | 25 | #expect_stdout="good morning\n" |
| 24 | 26 | |
| 25 | 27 | #update=reference new declaration |
| 26 | 28 | #file=main.zig |
| 27 | 29 | const std = @import("std"); |
| 28 | 30 | pub fn main() !void { |
| 29 | try std.Io.File.stdout().writeAll(bar); | |
| 31 | try std.Io.File.stdout().writeStreamingAll(io, bar); | |
| 30 | 32 | } |
| 31 | 33 | const foo = "good morning\n"; |
| 32 | 34 | const bar = "good evening\n"; |
| 35 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 33 | 36 | #expect_stdout="good evening\n" |
| 34 | 37 | |
| 35 | 38 | #update=reference missing declaration |
| 36 | 39 | #file=main.zig |
| 37 | 40 | const std = @import("std"); |
| 38 | 41 | pub fn main() !void { |
| 39 | try std.Io.File.stdout().writeAll(qux); | |
| 42 | try std.Io.File.stdout().writeStreamingAll(io, qux); | |
| 40 | 43 | } |
| 41 | 44 | const foo = "good morning\n"; |
| 42 | 45 | const bar = "good evening\n"; |
| 43 | #expect_error=main.zig:3:39: error: use of undeclared identifier 'qux' | |
| 46 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 47 | #expect_error=main.zig:3:52: error: use of undeclared identifier 'qux' | |
| 44 | 48 | |
| 45 | 49 | #update=add missing declaration |
| 46 | 50 | #file=main.zig |
| 47 | 51 | const std = @import("std"); |
| 48 | 52 | pub fn main() !void { |
| 49 | try std.Io.File.stdout().writeAll(qux); | |
| 53 | try std.Io.File.stdout().writeStreamingAll(io, qux); | |
| 50 | 54 | } |
| 51 | 55 | const foo = "good morning\n"; |
| 52 | 56 | const bar = "good evening\n"; |
| 53 | 57 | const qux = "good night\n"; |
| 58 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 54 | 59 | #expect_stdout="good night\n" |
| 55 | 60 | |
| 56 | 61 | #update=remove unused declarations |
| 57 | 62 | #file=main.zig |
| 58 | 63 | const std = @import("std"); |
| 59 | 64 | pub fn main() !void { |
| 60 | try std.Io.File.stdout().writeAll(qux); | |
| 65 | try std.Io.File.stdout().writeStreamingAll(io, qux); | |
| 61 | 66 | } |
| 62 | 67 | const qux = "good night\n"; |
| 68 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 63 | 69 | #expect_stdout="good night\n" |
test/incremental/add_decl_namespaced+13-7| ... | ... | @@ -7,58 +7,64 @@ |
| 7 | 7 | #file=main.zig |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | pub fn main() !void { |
| 10 | try std.Io.File.stdout().writeAll(@This().foo); | |
| 10 | try std.Io.File.stdout().writeStreamingAll(io, @This().foo); | |
| 11 | 11 | } |
| 12 | 12 | const foo = "good morning\n"; |
| 13 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 13 | 14 | #expect_stdout="good morning\n" |
| 14 | 15 | |
| 15 | 16 | #update=add new declaration |
| 16 | 17 | #file=main.zig |
| 17 | 18 | const std = @import("std"); |
| 18 | 19 | pub fn main() !void { |
| 19 | try std.Io.File.stdout().writeAll(@This().foo); | |
| 20 | try std.Io.File.stdout().writeStreamingAll(io, @This().foo); | |
| 20 | 21 | } |
| 21 | 22 | const foo = "good morning\n"; |
| 22 | 23 | const bar = "good evening\n"; |
| 24 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 23 | 25 | #expect_stdout="good morning\n" |
| 24 | 26 | |
| 25 | 27 | #update=reference new declaration |
| 26 | 28 | #file=main.zig |
| 27 | 29 | const std = @import("std"); |
| 28 | 30 | pub fn main() !void { |
| 29 | try std.Io.File.stdout().writeAll(@This().bar); | |
| 31 | try std.Io.File.stdout().writeStreamingAll(io, @This().bar); | |
| 30 | 32 | } |
| 31 | 33 | const foo = "good morning\n"; |
| 32 | 34 | const bar = "good evening\n"; |
| 35 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 33 | 36 | #expect_stdout="good evening\n" |
| 34 | 37 | |
| 35 | 38 | #update=reference missing declaration |
| 36 | 39 | #file=main.zig |
| 37 | 40 | const std = @import("std"); |
| 38 | 41 | pub fn main() !void { |
| 39 | try std.Io.File.stdout().writeAll(@This().qux); | |
| 42 | try std.Io.File.stdout().writeStreamingAll(io, @This().qux); | |
| 40 | 43 | } |
| 41 | 44 | const foo = "good morning\n"; |
| 42 | 45 | const bar = "good evening\n"; |
| 43 | #expect_error=main.zig:3:46: error: root source file struct 'main' has no member named 'qux' | |
| 46 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 47 | #expect_error=main.zig:3:59: error: root source file struct 'main' has no member named 'qux' | |
| 44 | 48 | #expect_error=main.zig:1:1: note: struct declared here |
| 45 | 49 | |
| 46 | 50 | #update=add missing declaration |
| 47 | 51 | #file=main.zig |
| 48 | 52 | const std = @import("std"); |
| 49 | 53 | pub fn main() !void { |
| 50 | try std.Io.File.stdout().writeAll(@This().qux); | |
| 54 | try std.Io.File.stdout().writeStreamingAll(io, @This().qux); | |
| 51 | 55 | } |
| 52 | 56 | const foo = "good morning\n"; |
| 53 | 57 | const bar = "good evening\n"; |
| 54 | 58 | const qux = "good night\n"; |
| 59 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 55 | 60 | #expect_stdout="good night\n" |
| 56 | 61 | |
| 57 | 62 | #update=remove unused declarations |
| 58 | 63 | #file=main.zig |
| 59 | 64 | const std = @import("std"); |
| 60 | 65 | pub fn main() !void { |
| 61 | try std.Io.File.stdout().writeAll(@This().qux); | |
| 66 | try std.Io.File.stdout().writeStreamingAll(io, @This().qux); | |
| 62 | 67 | } |
| 63 | 68 | const qux = "good night\n"; |
| 69 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 64 | 70 | #expect_stdout="good night\n" |
test/incremental/bad_import+4-2| ... | ... | @@ -8,9 +8,10 @@ |
| 8 | 8 | #file=main.zig |
| 9 | 9 | pub fn main() !void { |
| 10 | 10 | _ = @import("foo.zig"); |
| 11 | try std.Io.File.stdout().writeAll("success\n"); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, "success\n"); | |
| 12 | 12 | } |
| 13 | 13 | const std = @import("std"); |
| 14 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 14 | 15 | #file=foo.zig |
| 15 | 16 | comptime { |
| 16 | 17 | _ = @import("bad.zig"); |
| ... | ... | @@ -30,7 +31,8 @@ comptime { |
| 30 | 31 | #file=main.zig |
| 31 | 32 | pub fn main() !void { |
| 32 | 33 | //_ = @import("foo.zig"); |
| 33 | try std.Io.File.stdout().writeAll("success\n"); | |
| 34 | try std.Io.File.stdout().writeStreamingAll(io, "success\n"); | |
| 34 | 35 | } |
| 35 | 36 | const std = @import("std"); |
| 37 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 36 | 38 | #expect_stdout="success\n" |
test/incremental/change_embed_file+6-3| ... | ... | @@ -8,8 +8,9 @@ |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | const string = @embedFile("string.txt"); |
| 10 | 10 | pub fn main() !void { |
| 11 | try std.Io.File.stdout().writeAll(string); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, string); | |
| 12 | 12 | } |
| 13 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 13 | 14 | #file=string.txt |
| 14 | 15 | Hello, World! |
| 15 | 16 | #expect_stdout="Hello, World!\n" |
| ... | ... | @@ -28,8 +29,9 @@ Hello again, World! |
| 28 | 29 | const std = @import("std"); |
| 29 | 30 | const string = @embedFile("string.txt"); |
| 30 | 31 | pub fn main() !void { |
| 31 | try std.Io.File.stdout().writeAll("a hardcoded string\n"); | |
| 32 | try std.Io.File.stdout().writeStreamingAll(io, "a hardcoded string\n"); | |
| 32 | 33 | } |
| 34 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 33 | 35 | #expect_stdout="a hardcoded string\n" |
| 34 | 36 | |
| 35 | 37 | #update=re-introduce reference to file |
| ... | ... | @@ -37,8 +39,9 @@ pub fn main() !void { |
| 37 | 39 | const std = @import("std"); |
| 38 | 40 | const string = @embedFile("string.txt"); |
| 39 | 41 | pub fn main() !void { |
| 40 | try std.Io.File.stdout().writeAll(string); | |
| 42 | try std.Io.File.stdout().writeStreamingAll(io, string); | |
| 41 | 43 | } |
| 44 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 42 | 45 | #expect_error=main.zig:2:27: error: unable to open 'string.txt': FileNotFound |
| 43 | 46 | |
| 44 | 47 | #update=recreate file |
test/incremental/change_enum_tag_type+6-3| ... | ... | @@ -15,10 +15,11 @@ const Foo = enum(Tag) { |
| 15 | 15 | pub fn main() !void { |
| 16 | 16 | var val: Foo = undefined; |
| 17 | 17 | val = .a; |
| 18 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 18 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 19 | 19 | try stdout_writer.interface.print("{s}\n", .{@tagName(val)}); |
| 20 | 20 | } |
| 21 | 21 | const std = @import("std"); |
| 22 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 22 | 23 | #expect_stdout="a\n" |
| 23 | 24 | #update=too many enum fields |
| 24 | 25 | #file=main.zig |
| ... | ... | @@ -33,7 +34,7 @@ const Foo = enum(Tag) { |
| 33 | 34 | pub fn main() !void { |
| 34 | 35 | var val: Foo = undefined; |
| 35 | 36 | val = .a; |
| 36 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 37 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 37 | 38 | try stdout_writer.interface.print("{s}\n", .{@tagName(val)}); |
| 38 | 39 | } |
| 39 | 40 | comptime { |
| ... | ... | @@ -42,6 +43,7 @@ comptime { |
| 42 | 43 | std.debug.assert(@TypeOf(@intFromEnum(Foo.e)) == Tag); |
| 43 | 44 | } |
| 44 | 45 | const std = @import("std"); |
| 46 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 45 | 47 | #expect_error=main.zig:7:5: error: enumeration value '4' too large for type 'u2' |
| 46 | 48 | #update=increase tag size |
| 47 | 49 | #file=main.zig |
| ... | ... | @@ -56,8 +58,9 @@ const Foo = enum(Tag) { |
| 56 | 58 | pub fn main() !void { |
| 57 | 59 | var val: Foo = undefined; |
| 58 | 60 | val = .a; |
| 59 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 61 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 60 | 62 | try stdout_writer.interface.print("{s}\n", .{@tagName(val)}); |
| 61 | 63 | } |
| 62 | 64 | const std = @import("std"); |
| 65 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 63 | 66 | #expect_stdout="a\n" |
test/incremental/change_exports+12-6| ... | ... | @@ -17,10 +17,11 @@ pub fn main() !void { |
| 17 | 17 | extern const bar: u32; |
| 18 | 18 | }; |
| 19 | 19 | S.foo(); |
| 20 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 20 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 21 | 21 | try stdout_writer.interface.print("{}\n", .{S.bar}); |
| 22 | 22 | } |
| 23 | 23 | const std = @import("std"); |
| 24 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 24 | 25 | #expect_stdout="123\n" |
| 25 | 26 | |
| 26 | 27 | #update=add conflict |
| ... | ... | @@ -39,10 +40,11 @@ pub fn main() !void { |
| 39 | 40 | extern const other: u32; |
| 40 | 41 | }; |
| 41 | 42 | S.foo(); |
| 42 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 43 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 43 | 44 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 44 | 45 | } |
| 45 | 46 | const std = @import("std"); |
| 47 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 46 | 48 | #expect_error=main.zig:6:5: error: exported symbol collision: foo |
| 47 | 49 | #expect_error=main.zig:1:1: note: other symbol here |
| 48 | 50 | |
| ... | ... | @@ -62,10 +64,11 @@ pub fn main() !void { |
| 62 | 64 | extern const other: u32; |
| 63 | 65 | }; |
| 64 | 66 | S.foo(); |
| 65 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 67 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 66 | 68 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 67 | 69 | } |
| 68 | 70 | const std = @import("std"); |
| 71 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 69 | 72 | #expect_stdout="123 456\n" |
| 70 | 73 | |
| 71 | 74 | #update=put exports in decl |
| ... | ... | @@ -87,10 +90,11 @@ pub fn main() !void { |
| 87 | 90 | extern const other: u32; |
| 88 | 91 | }; |
| 89 | 92 | S.foo(); |
| 90 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 93 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 91 | 94 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 92 | 95 | } |
| 93 | 96 | const std = @import("std"); |
| 97 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 94 | 98 | #expect_stdout="123 456\n" |
| 95 | 99 | |
| 96 | 100 | #update=remove reference to exporting decl |
| ... | ... | @@ -133,10 +137,11 @@ pub fn main() !void { |
| 133 | 137 | extern const other: u32; |
| 134 | 138 | }; |
| 135 | 139 | S.foo(); |
| 136 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 140 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 137 | 141 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 138 | 142 | } |
| 139 | 143 | const std = @import("std"); |
| 144 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 140 | 145 | #expect_stdout="123 456\n" |
| 141 | 146 | |
| 142 | 147 | #update=reintroduce reference to exporting decl, introducing conflict |
| ... | ... | @@ -158,10 +163,11 @@ pub fn main() !void { |
| 158 | 163 | extern const other: u32; |
| 159 | 164 | }; |
| 160 | 165 | S.foo(); |
| 161 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 166 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 162 | 167 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 163 | 168 | } |
| 164 | 169 | const std = @import("std"); |
| 170 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 165 | 171 | #expect_error=main.zig:5:5: error: exported symbol collision: bar |
| 166 | 172 | #expect_error=main.zig:2:1: note: other symbol here |
| 167 | 173 | #expect_error=main.zig:6:5: error: exported symbol collision: other |
test/incremental/change_fn_type+6-3| ... | ... | @@ -8,10 +8,11 @@ pub fn main() !void { |
| 8 | 8 | try foo(123); |
| 9 | 9 | } |
| 10 | 10 | fn foo(x: u8) !void { |
| 11 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 11 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 12 | 12 | return stdout_writer.interface.print("{d}\n", .{x}); |
| 13 | 13 | } |
| 14 | 14 | const std = @import("std"); |
| 15 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 15 | 16 | #expect_stdout="123\n" |
| 16 | 17 | |
| 17 | 18 | #update=change function type |
| ... | ... | @@ -20,10 +21,11 @@ pub fn main() !void { |
| 20 | 21 | try foo(123); |
| 21 | 22 | } |
| 22 | 23 | fn foo(x: i64) !void { |
| 23 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 24 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 24 | 25 | return stdout_writer.interface.print("{d}\n", .{x}); |
| 25 | 26 | } |
| 26 | 27 | const std = @import("std"); |
| 28 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 27 | 29 | #expect_stdout="123\n" |
| 28 | 30 | |
| 29 | 31 | #update=change function argument |
| ... | ... | @@ -32,8 +34,9 @@ pub fn main() !void { |
| 32 | 34 | try foo(-42); |
| 33 | 35 | } |
| 34 | 36 | fn foo(x: i64) !void { |
| 35 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 37 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 36 | 38 | return stdout_writer.interface.print("{d}\n", .{x}); |
| 37 | 39 | } |
| 38 | 40 | const std = @import("std"); |
| 41 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 39 | 42 | #expect_stdout="-42\n" |
test/incremental/change_generic_line_number+4-2| ... | ... | @@ -4,10 +4,11 @@ |
| 4 | 4 | #update=initial version |
| 5 | 5 | #file=main.zig |
| 6 | 6 | const std = @import("std"); |
| 7 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 7 | 8 | fn Printer(message: []const u8) type { |
| 8 | 9 | return struct { |
| 9 | 10 | fn print() !void { |
| 10 | try std.Io.File.stdout().writeAll(message); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, message); | |
| 11 | 12 | } |
| 12 | 13 | }; |
| 13 | 14 | } |
| ... | ... | @@ -19,11 +20,12 @@ pub fn main() !void { |
| 19 | 20 | #update=change line number |
| 20 | 21 | #file=main.zig |
| 21 | 22 | const std = @import("std"); |
| 23 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 22 | 24 | |
| 23 | 25 | fn Printer(message: []const u8) type { |
| 24 | 26 | return struct { |
| 25 | 27 | fn print() !void { |
| 26 | try std.Io.File.stdout().writeAll(message); | |
| 28 | try std.Io.File.stdout().writeStreamingAll(io, message); | |
| 27 | 29 | } |
| 28 | 30 | }; |
| 29 | 31 | } |
test/incremental/change_line_number+4-2| ... | ... | @@ -5,14 +5,16 @@ |
| 5 | 5 | #file=main.zig |
| 6 | 6 | const std = @import("std"); |
| 7 | 7 | pub fn main() !void { |
| 8 | try std.Io.File.stdout().writeAll("foo\n"); | |
| 8 | try std.Io.File.stdout().writeStreamingAll(io, "foo\n"); | |
| 9 | 9 | } |
| 10 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 10 | 11 | #expect_stdout="foo\n" |
| 11 | 12 | #update=change line number |
| 12 | 13 | #file=main.zig |
| 13 | 14 | const std = @import("std"); |
| 14 | 15 | |
| 15 | 16 | pub fn main() !void { |
| 16 | try std.Io.File.stdout().writeAll("foo\n"); | |
| 17 | try std.Io.File.stdout().writeStreamingAll(io, "foo\n"); | |
| 17 | 18 | } |
| 19 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 18 | 20 | #expect_stdout="foo\n" |
test/incremental/change_panic_handler+6-3| ... | ... | @@ -12,11 +12,12 @@ pub fn main() !u8 { |
| 12 | 12 | } |
| 13 | 13 | pub const panic = std.debug.FullPanic(myPanic); |
| 14 | 14 | fn myPanic(msg: []const u8, _: ?usize) noreturn { |
| 15 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 15 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 16 | 16 | stdout_writer.interface.print("panic message: {s}\n", .{msg}) catch {}; |
| 17 | 17 | std.process.exit(0); |
| 18 | 18 | } |
| 19 | 19 | const std = @import("std"); |
| 20 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 20 | 21 | #expect_stdout="panic message: integer overflow\n" |
| 21 | 22 | |
| 22 | 23 | #update=change the panic handler body |
| ... | ... | @@ -29,11 +30,12 @@ pub fn main() !u8 { |
| 29 | 30 | } |
| 30 | 31 | pub const panic = std.debug.FullPanic(myPanic); |
| 31 | 32 | fn myPanic(msg: []const u8, _: ?usize) noreturn { |
| 32 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 33 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 33 | 34 | stdout_writer.interface.print("new panic message: {s}\n", .{msg}) catch {}; |
| 34 | 35 | std.process.exit(0); |
| 35 | 36 | } |
| 36 | 37 | const std = @import("std"); |
| 38 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 37 | 39 | #expect_stdout="new panic message: integer overflow\n" |
| 38 | 40 | |
| 39 | 41 | #update=change the panic handler function value |
| ... | ... | @@ -46,9 +48,10 @@ pub fn main() !u8 { |
| 46 | 48 | } |
| 47 | 49 | pub const panic = std.debug.FullPanic(myPanicNew); |
| 48 | 50 | fn myPanicNew(msg: []const u8, _: ?usize) noreturn { |
| 49 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 51 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 50 | 52 | stdout_writer.interface.print("third panic message: {s}\n", .{msg}) catch {}; |
| 51 | 53 | std.process.exit(0); |
| 52 | 54 | } |
| 53 | 55 | const std = @import("std"); |
| 56 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 54 | 57 | #expect_stdout="third panic message: integer overflow\n" |
test/incremental/change_panic_handler_explicit+6-3| ... | ... | @@ -42,11 +42,12 @@ pub const panic = struct { |
| 42 | 42 | pub const noreturnReturned = no_panic.noreturnReturned; |
| 43 | 43 | }; |
| 44 | 44 | fn myPanic(msg: []const u8, _: ?usize) noreturn { |
| 45 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 45 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 46 | 46 | stdout_writer.interface.print("panic message: {s}\n", .{msg}) catch {}; |
| 47 | 47 | std.process.exit(0); |
| 48 | 48 | } |
| 49 | 49 | const std = @import("std"); |
| 50 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 50 | 51 | #expect_stdout="panic message: integer overflow\n" |
| 51 | 52 | |
| 52 | 53 | #update=change the panic handler body |
| ... | ... | @@ -89,11 +90,12 @@ pub const panic = struct { |
| 89 | 90 | pub const noreturnReturned = no_panic.noreturnReturned; |
| 90 | 91 | }; |
| 91 | 92 | fn myPanic(msg: []const u8, _: ?usize) noreturn { |
| 92 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 93 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 93 | 94 | stdout_writer.interface.print("new panic message: {s}\n", .{msg}) catch {}; |
| 94 | 95 | std.process.exit(0); |
| 95 | 96 | } |
| 96 | 97 | const std = @import("std"); |
| 98 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 97 | 99 | #expect_stdout="new panic message: integer overflow\n" |
| 98 | 100 | |
| 99 | 101 | #update=change the panic handler function value |
| ... | ... | @@ -136,9 +138,10 @@ pub const panic = struct { |
| 136 | 138 | pub const noreturnReturned = no_panic.noreturnReturned; |
| 137 | 139 | }; |
| 138 | 140 | fn myPanicNew(msg: []const u8, _: ?usize) noreturn { |
| 139 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 141 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 140 | 142 | stdout_writer.interface.print("third panic message: {s}\n", .{msg}) catch {}; |
| 141 | 143 | std.process.exit(0); |
| 142 | 144 | } |
| 143 | 145 | const std = @import("std"); |
| 146 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 144 | 147 | #expect_stdout="third panic message: integer overflow\n" |
test/incremental/change_shift_op+4-2| ... | ... | @@ -9,10 +9,11 @@ pub fn main() !void { |
| 9 | 9 | try foo(0x1300); |
| 10 | 10 | } |
| 11 | 11 | fn foo(x: u16) !void { |
| 12 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 12 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 13 | 13 | try stdout_writer.interface.print("0x{x}\n", .{x << 4}); |
| 14 | 14 | } |
| 15 | 15 | const std = @import("std"); |
| 16 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 16 | 17 | #expect_stdout="0x3000\n" |
| 17 | 18 | #update=change to right shift |
| 18 | 19 | #file=main.zig |
| ... | ... | @@ -20,8 +21,9 @@ pub fn main() !void { |
| 20 | 21 | try foo(0x1300); |
| 21 | 22 | } |
| 22 | 23 | fn foo(x: u16) !void { |
| 23 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 24 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 24 | 25 | try stdout_writer.interface.print("0x{x}\n", .{x >> 4}); |
| 25 | 26 | } |
| 26 | 27 | const std = @import("std"); |
| 28 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 27 | 29 | #expect_stdout="0x130\n" |
test/incremental/change_struct_same_fields+6-3| ... | ... | @@ -11,13 +11,14 @@ pub fn main() !void { |
| 11 | 11 | try foo(&val); |
| 12 | 12 | } |
| 13 | 13 | fn foo(val: *const S) !void { |
| 14 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 14 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 15 | 15 | try stdout_writer.interface.print( |
| 16 | 16 | "{d} {d}\n", |
| 17 | 17 | .{ val.x, val.y }, |
| 18 | 18 | ); |
| 19 | 19 | } |
| 20 | 20 | const std = @import("std"); |
| 21 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 21 | 22 | #expect_stdout="100 200\n" |
| 22 | 23 | |
| 23 | 24 | #update=change struct layout |
| ... | ... | @@ -28,13 +29,14 @@ pub fn main() !void { |
| 28 | 29 | try foo(&val); |
| 29 | 30 | } |
| 30 | 31 | fn foo(val: *const S) !void { |
| 31 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 32 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 32 | 33 | try stdout_writer.interface.print( |
| 33 | 34 | "{d} {d}\n", |
| 34 | 35 | .{ val.x, val.y }, |
| 35 | 36 | ); |
| 36 | 37 | } |
| 37 | 38 | const std = @import("std"); |
| 39 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 38 | 40 | #expect_stdout="100 200\n" |
| 39 | 41 | |
| 40 | 42 | #update=change values |
| ... | ... | @@ -45,11 +47,12 @@ pub fn main() !void { |
| 45 | 47 | try foo(&val); |
| 46 | 48 | } |
| 47 | 49 | fn foo(val: *const S) !void { |
| 48 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 50 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 49 | 51 | try stdout_writer.interface.print( |
| 50 | 52 | "{d} {d}\n", |
| 51 | 53 | .{ val.x, val.y }, |
| 52 | 54 | ); |
| 53 | 55 | } |
| 54 | 56 | const std = @import("std"); |
| 57 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 55 | 58 | #expect_stdout="1234 5678\n" |
test/incremental/change_zon_file+6-3| ... | ... | @@ -8,8 +8,9 @@ |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | const message: []const u8 = @import("message.zon"); |
| 10 | 10 | pub fn main() !void { |
| 11 | try std.Io.File.stdout().writeAll(message); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, message); | |
| 12 | 12 | } |
| 13 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 13 | 14 | #file=message.zon |
| 14 | 15 | "Hello, World!\n" |
| 15 | 16 | #expect_stdout="Hello, World!\n" |
| ... | ... | @@ -29,8 +30,9 @@ pub fn main() !void { |
| 29 | 30 | const std = @import("std"); |
| 30 | 31 | const message: []const u8 = @import("message.zon"); |
| 31 | 32 | pub fn main() !void { |
| 32 | try std.Io.File.stdout().writeAll("a hardcoded string\n"); | |
| 33 | try std.Io.File.stdout().writeStreamingAll(io, "a hardcoded string\n"); | |
| 33 | 34 | } |
| 35 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 34 | 36 | #expect_error=message.zon:1:1: error: unable to load 'message.zon': FileNotFound |
| 35 | 37 | #expect_error=main.zig:2:37: note: file imported here |
| 36 | 38 | |
| ... | ... | @@ -44,6 +46,7 @@ pub fn main() !void { |
| 44 | 46 | const std = @import("std"); |
| 45 | 47 | const message: []const u8 = @import("message.zon"); |
| 46 | 48 | pub fn main() !void { |
| 47 | try std.Io.File.stdout().writeAll(message); | |
| 49 | try std.Io.File.stdout().writeStreamingAll(io, message); | |
| 48 | 50 | } |
| 51 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 49 | 52 | #expect_stdout="We're back, World!\n" |
test/incremental/change_zon_file_no_result_type+2-1| ... | ... | @@ -6,8 +6,9 @@ |
| 6 | 6 | #update=initial version |
| 7 | 7 | #file=main.zig |
| 8 | 8 | const std = @import("std"); |
| 9 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 9 | 10 | pub fn main() !void { |
| 10 | try std.Io.File.stdout().writeAll(@import("foo.zon").message); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, @import("foo.zon").message); | |
| 11 | 12 | } |
| 12 | 13 | #file=foo.zon |
| 13 | 14 | .{ |
test/incremental/compile_log+6-3| ... | ... | @@ -8,17 +8,19 @@ |
| 8 | 8 | #file=main.zig |
| 9 | 9 | const std = @import("std"); |
| 10 | 10 | pub fn main() !void { |
| 11 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 12 | 12 | } |
| 13 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 13 | 14 | #expect_stdout="Hello, World!\n" |
| 14 | 15 | |
| 15 | 16 | #update=add compile log |
| 16 | 17 | #file=main.zig |
| 17 | 18 | const std = @import("std"); |
| 18 | 19 | pub fn main() !void { |
| 19 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 20 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 20 | 21 | @compileLog("this is a log"); |
| 21 | 22 | } |
| 23 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 22 | 24 | #expect_error=main.zig:4:5: error: found compile log statement |
| 23 | 25 | #expect_compile_log=@as(*const [13:0]u8, "this is a log") |
| 24 | 26 | |
| ... | ... | @@ -26,6 +28,7 @@ pub fn main() !void { |
| 26 | 28 | #file=main.zig |
| 27 | 29 | const std = @import("std"); |
| 28 | 30 | pub fn main() !void { |
| 29 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 31 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 30 | 32 | } |
| 33 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 31 | 34 | #expect_stdout="Hello, World!\n" |
test/incremental/fix_astgen_failure+8-5| ... | ... | @@ -10,28 +10,31 @@ pub fn main() !void { |
| 10 | 10 | } |
| 11 | 11 | #file=foo.zig |
| 12 | 12 | pub fn hello() !void { |
| 13 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 13 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 14 | 14 | } |
| 15 | 15 | #expect_error=foo.zig:2:9: error: use of undeclared identifier 'std' |
| 16 | 16 | #update=fix the error |
| 17 | 17 | #file=foo.zig |
| 18 | 18 | const std = @import("std"); |
| 19 | 19 | pub fn hello() !void { |
| 20 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 20 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 21 | 21 | } |
| 22 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 22 | 23 | #expect_stdout="Hello, World!\n" |
| 23 | 24 | #update=add new error |
| 24 | 25 | #file=foo.zig |
| 25 | 26 | const std = @import("std"); |
| 26 | 27 | pub fn hello() !void { |
| 27 | try std.Io.File.stdout().writeAll(hello_str); | |
| 28 | try std.Io.File.stdout().writeStreamingAll(io, hello_str); | |
| 28 | 29 | } |
| 29 | #expect_error=foo.zig:3:39: error: use of undeclared identifier 'hello_str' | |
| 30 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 31 | #expect_error=foo.zig:3:52: error: use of undeclared identifier 'hello_str' | |
| 30 | 32 | #update=fix the new error |
| 31 | 33 | #file=foo.zig |
| 32 | 34 | const std = @import("std"); |
| 33 | 35 | const hello_str = "Hello, World! Again!\n"; |
| 34 | 36 | pub fn hello() !void { |
| 35 | try std.Io.File.stdout().writeAll(hello_str); | |
| 37 | try std.Io.File.stdout().writeStreamingAll(io, hello_str); | |
| 36 | 38 | } |
| 39 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 37 | 40 | #expect_stdout="Hello, World! Again!\n" |
test/incremental/function_becomes_inline+6-3| ... | ... | @@ -8,9 +8,10 @@ pub fn main() !void { |
| 8 | 8 | try foo(); |
| 9 | 9 | } |
| 10 | 10 | fn foo() !void { |
| 11 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 12 | 12 | } |
| 13 | 13 | const std = @import("std"); |
| 14 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 14 | 15 | #expect_stdout="Hello, World!\n" |
| 15 | 16 | |
| 16 | 17 | #update=make function inline |
| ... | ... | @@ -19,9 +20,10 @@ pub fn main() !void { |
| 19 | 20 | try foo(); |
| 20 | 21 | } |
| 21 | 22 | inline fn foo() !void { |
| 22 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 23 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 23 | 24 | } |
| 24 | 25 | const std = @import("std"); |
| 26 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 25 | 27 | #expect_stdout="Hello, World!\n" |
| 26 | 28 | |
| 27 | 29 | #update=change string |
| ... | ... | @@ -30,7 +32,8 @@ pub fn main() !void { |
| 30 | 32 | try foo(); |
| 31 | 33 | } |
| 32 | 34 | inline fn foo() !void { |
| 33 | try std.Io.File.stdout().writeAll("Hello, `inline` World!\n"); | |
| 35 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, `inline` World!\n"); | |
| 34 | 36 | } |
| 35 | 37 | const std = @import("std"); |
| 38 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 36 | 39 | #expect_stdout="Hello, `inline` World!\n" |
test/incremental/hello+4-2| ... | ... | @@ -6,14 +6,16 @@ |
| 6 | 6 | #update=initial version |
| 7 | 7 | #file=main.zig |
| 8 | 8 | const std = @import("std"); |
| 9 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 9 | 10 | pub fn main() !void { |
| 10 | try std.Io.File.stdout().writeAll("good morning\n"); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, "good morning\n"); | |
| 11 | 12 | } |
| 12 | 13 | #expect_stdout="good morning\n" |
| 13 | 14 | #update=change the string |
| 14 | 15 | #file=main.zig |
| 15 | 16 | const std = @import("std"); |
| 17 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 16 | 18 | pub fn main() !void { |
| 17 | try std.Io.File.stdout().writeAll("おはようございます\n"); | |
| 19 | try std.Io.File.stdout().writeStreamingAll(io, "おはようございます\n"); | |
| 18 | 20 | } |
| 19 | 21 | #expect_stdout="おはようございます\n" |
test/incremental/make_decl_pub+4-2| ... | ... | @@ -12,8 +12,9 @@ pub fn main() !void { |
| 12 | 12 | #file=foo.zig |
| 13 | 13 | const std = @import("std"); |
| 14 | 14 | fn hello() !void { |
| 15 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 15 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 16 | 16 | } |
| 17 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 17 | 18 | #expect_error=main.zig:3:12: error: 'hello' is not marked 'pub' |
| 18 | 19 | #expect_error=foo.zig:2:1: note: declared here |
| 19 | 20 | |
| ... | ... | @@ -21,6 +22,7 @@ fn hello() !void { |
| 21 | 22 | #file=foo.zig |
| 22 | 23 | const std = @import("std"); |
| 23 | 24 | pub fn hello() !void { |
| 24 | try std.Io.File.stdout().writeAll("Hello, World!\n"); | |
| 25 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); | |
| 25 | 26 | } |
| 27 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 26 | 28 | #expect_stdout="Hello, World!\n" |
test/incremental/modify_inline_fn+4-2| ... | ... | @@ -8,20 +8,22 @@ |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | pub fn main() !void { |
| 10 | 10 | const str = getStr(); |
| 11 | try std.Io.File.stdout().writeAll(str); | |
| 11 | try std.Io.File.stdout().writeStreamingAll(io, str); | |
| 12 | 12 | } |
| 13 | 13 | inline fn getStr() []const u8 { |
| 14 | 14 | return "foo\n"; |
| 15 | 15 | } |
| 16 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 16 | 17 | #expect_stdout="foo\n" |
| 17 | 18 | #update=change the string |
| 18 | 19 | #file=main.zig |
| 19 | 20 | const std = @import("std"); |
| 20 | 21 | pub fn main() !void { |
| 21 | 22 | const str = getStr(); |
| 22 | try std.Io.File.stdout().writeAll(str); | |
| 23 | try std.Io.File.stdout().writeStreamingAll(io, str); | |
| 23 | 24 | } |
| 24 | 25 | inline fn getStr() []const u8 { |
| 25 | 26 | return "bar\n"; |
| 26 | 27 | } |
| 28 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 27 | 29 | #expect_stdout="bar\n" |
test/incremental/move_src+4-2| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | #file=main.zig |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | pub fn main() !void { |
| 10 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 10 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 11 | 11 | try stdout_writer.interface.print("{d} {d}\n", .{ foo(), bar() }); |
| 12 | 12 | } |
| 13 | 13 | fn foo() u32 { |
| ... | ... | @@ -16,13 +16,14 @@ fn foo() u32 { |
| 16 | 16 | fn bar() u32 { |
| 17 | 17 | return 123; |
| 18 | 18 | } |
| 19 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 19 | 20 | #expect_stdout="7 123\n" |
| 20 | 21 | |
| 21 | 22 | #update=add newline |
| 22 | 23 | #file=main.zig |
| 23 | 24 | const std = @import("std"); |
| 24 | 25 | pub fn main() !void { |
| 25 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 26 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 26 | 27 | try stdout_writer.interface.print("{d} {d}\n", .{ foo(), bar() }); |
| 27 | 28 | } |
| 28 | 29 | |
| ... | ... | @@ -32,4 +33,5 @@ fn foo() u32 { |
| 32 | 33 | fn bar() u32 { |
| 33 | 34 | return 123; |
| 34 | 35 | } |
| 36 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 35 | 37 | #expect_stdout="8 123\n" |
test/incremental/no_change_preserves_tag_names+4-2| ... | ... | @@ -7,15 +7,17 @@ |
| 7 | 7 | #file=main.zig |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | var some_enum: enum { first, second } = .first; |
| 10 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 10 | 11 | pub fn main() !void { |
| 11 | try std.Io.File.stdout().writeStreamingAll(std.Io.Threaded.global_single_threaded.ioBasic(), @tagName(some_enum)); | |
| 12 | try std.Io.File.stdout().writeStreamingAll(io, @tagName(some_enum)); | |
| 12 | 13 | } |
| 13 | 14 | #expect_stdout="first" |
| 14 | 15 | #update=no change |
| 15 | 16 | #file=main.zig |
| 16 | 17 | const std = @import("std"); |
| 17 | 18 | var some_enum: enum { first, second } = .first; |
| 19 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 18 | 20 | pub fn main() !void { |
| 19 | try std.Io.File.stdout().writeStreamingAll(std.Io.Threaded.global_single_threaded.ioBasic(), @tagName(some_enum)); | |
| 21 | try std.Io.File.stdout().writeStreamingAll(io, @tagName(some_enum)); | |
| 20 | 22 | } |
| 21 | 23 | #expect_stdout="first" |
test/incremental/recursive_function_becomes_non_recursive+5-3| ... | ... | @@ -11,9 +11,10 @@ pub fn main() !void { |
| 11 | 11 | fn foo(recurse: bool) !void { |
| 12 | 12 | const stdout = std.Io.File.stdout(); |
| 13 | 13 | if (recurse) return foo(true); |
| 14 | try stdout.writeAll("non-recursive path\n"); | |
| 14 | try stdout.writeStreamingAll(io, "non-recursive path\n"); | |
| 15 | 15 | } |
| 16 | 16 | const std = @import("std"); |
| 17 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 17 | 18 | #expect_stdout="non-recursive path\n" |
| 18 | 19 | |
| 19 | 20 | #update=eliminate recursion and change argument |
| ... | ... | @@ -23,8 +24,9 @@ pub fn main() !void { |
| 23 | 24 | } |
| 24 | 25 | fn foo(recurse: bool) !void { |
| 25 | 26 | const stdout = std.Io.File.stdout(); |
| 26 | if (recurse) return stdout.writeAll("x==1\n"); | |
| 27 | try stdout.writeAll("non-recursive path\n"); | |
| 27 | if (recurse) return stdout.writeStreamingAll(io, "x==1\n"); | |
| 28 | try stdout.writeStreamingAll(io, "non-recursive path\n"); | |
| 28 | 29 | } |
| 29 | 30 | const std = @import("std"); |
| 31 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 30 | 32 | #expect_stdout="x==1\n" |
test/incremental/remove_enum_field+4-2| ... | ... | @@ -10,10 +10,11 @@ const MyEnum = enum(u8) { |
| 10 | 10 | bar = 2, |
| 11 | 11 | }; |
| 12 | 12 | pub fn main() !void { |
| 13 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 13 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 14 | 14 | try stdout_writer.interface.print("{}\n", .{@intFromEnum(MyEnum.foo)}); |
| 15 | 15 | } |
| 16 | 16 | const std = @import("std"); |
| 17 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 17 | 18 | #expect_stdout="1\n" |
| 18 | 19 | #update=remove enum field |
| 19 | 20 | #file=main.zig |
| ... | ... | @@ -22,9 +23,10 @@ const MyEnum = enum(u8) { |
| 22 | 23 | bar = 2, |
| 23 | 24 | }; |
| 24 | 25 | pub fn main() !void { |
| 25 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); | |
| 26 | var stdout_writer = std.Io.File.stdout().writerStreaming(io, &.{}); | |
| 26 | 27 | try stdout_writer.interface.print("{}\n", .{@intFromEnum(MyEnum.foo)}); |
| 27 | 28 | } |
| 28 | 29 | const std = @import("std"); |
| 30 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 29 | 31 | #expect_error=main.zig:7:69: error: enum 'main.MyEnum' has no member named 'foo' |
| 30 | 32 | #expect_error=main.zig:1:16: note: enum declared here |
test/incremental/unreferenced_error+8-4| ... | ... | @@ -7,36 +7,40 @@ |
| 7 | 7 | #file=main.zig |
| 8 | 8 | const std = @import("std"); |
| 9 | 9 | pub fn main() !void { |
| 10 | try std.Io.File.stdout().writeAll(a); | |
| 10 | try std.Io.File.stdout().writeStreamingAll(io, a); | |
| 11 | 11 | } |
| 12 | 12 | const a = "Hello, World!\n"; |
| 13 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 13 | 14 | #expect_stdout="Hello, World!\n" |
| 14 | 15 | |
| 15 | 16 | #update=introduce compile error |
| 16 | 17 | #file=main.zig |
| 17 | 18 | const std = @import("std"); |
| 18 | 19 | pub fn main() !void { |
| 19 | try std.Io.File.stdout().writeAll(a); | |
| 20 | try std.Io.File.stdout().writeStreamingAll(io, a); | |
| 20 | 21 | } |
| 21 | 22 | const a = @compileError("bad a"); |
| 23 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 22 | 24 | #expect_error=main.zig:5:11: error: bad a |
| 23 | 25 | |
| 24 | 26 | #update=remove error reference |
| 25 | 27 | #file=main.zig |
| 26 | 28 | const std = @import("std"); |
| 27 | 29 | pub fn main() !void { |
| 28 | try std.Io.File.stdout().writeAll(b); | |
| 30 | try std.Io.File.stdout().writeStreamingAll(io, b); | |
| 29 | 31 | } |
| 30 | 32 | const a = @compileError("bad a"); |
| 31 | 33 | const b = "Hi there!\n"; |
| 34 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 32 | 35 | #expect_stdout="Hi there!\n" |
| 33 | 36 | |
| 34 | 37 | #update=introduce and remove reference to error |
| 35 | 38 | #file=main.zig |
| 36 | 39 | const std = @import("std"); |
| 37 | 40 | pub fn main() !void { |
| 38 | try std.Io.File.stdout().writeAll(a); | |
| 41 | try std.Io.File.stdout().writeStreamingAll(io, a); | |
| 39 | 42 | } |
| 40 | 43 | const a = "Back to a\n"; |
| 41 | 44 | const b = @compileError("bad b"); |
| 45 | const io = std.Io.Threaded.global_single_threaded.ioBasic(); | |
| 42 | 46 | #expect_stdout="Back to a\n" |