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