| author | |
| committer | |
| log | a91c6dc71d42ea59ec53ce4e0ae83e4970731313 |
| tree | 815a549f1f16d6c6ce37d6f2d3034c484bb18ca9 |
| parent | 1dcfc8787e86ed94d216976e621a49fc488e8214 |
43 files changed, 106 insertions(+), 102 deletions(-)
test/cases/disable_stack_tracing.zig+1-1| ... | @@ -5,7 +5,7 @@ pub const std_options: std.Options = .{ | ... | @@ -5,7 +5,7 @@ pub const std_options: std.Options = .{ |
| 5 | pub fn main() !void { | 5 | pub fn main() !void { |
| 6 | var st_buf: [8]usize = undefined; | 6 | var st_buf: [8]usize = undefined; |
| 7 | var buf: [1024]u8 = undefined; | 7 | var buf: [1024]u8 = undefined; |
| 8 | var stdout = std.fs.File.stdout().writer(&buf); | 8 | var stdout = std.Io.File.stdout().writer(&buf); |
| 9 | 9 | ||
| 10 | const captured_st = try foo(&stdout.interface, &st_buf); | 10 | const captured_st = try foo(&stdout.interface, &st_buf); |
| 11 | try std.debug.writeStackTrace(&captured_st, &stdout.interface, .no_color); | 11 | try std.debug.writeStackTrace(&captured_st, &stdout.interface, .no_color); |
test/incremental/add_decl+6-6| ... | @@ -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 | try std.fs.File.stdout().writeAll(foo); | 10 | try std.Io.File.stdout().writeAll(foo); |
| 11 | } | 11 | } |
| 12 | const foo = "good morning\n"; | 12 | const foo = "good morning\n"; |
| 13 | #expect_stdout="good morning\n" | 13 | #expect_stdout="good morning\n" |
| ... | @@ -16,7 +16,7 @@ const foo = "good morning\n"; | ... | @@ -16,7 +16,7 @@ const foo = "good morning\n"; |
| 16 | #file=main.zig | 16 | #file=main.zig |
| 17 | const std = @import("std"); | 17 | const std = @import("std"); |
| 18 | pub fn main() !void { | 18 | pub fn main() !void { |
| 19 | try std.fs.File.stdout().writeAll(foo); | 19 | try std.Io.File.stdout().writeAll(foo); |
| 20 | } | 20 | } |
| 21 | const foo = "good morning\n"; | 21 | const foo = "good morning\n"; |
| 22 | const bar = "good evening\n"; | 22 | const bar = "good evening\n"; |
| ... | @@ -26,7 +26,7 @@ const bar = "good evening\n"; | ... | @@ -26,7 +26,7 @@ const bar = "good evening\n"; |
| 26 | #file=main.zig | 26 | #file=main.zig |
| 27 | const std = @import("std"); | 27 | const std = @import("std"); |
| 28 | pub fn main() !void { | 28 | pub fn main() !void { |
| 29 | try std.fs.File.stdout().writeAll(bar); | 29 | try std.Io.File.stdout().writeAll(bar); |
| 30 | } | 30 | } |
| 31 | const foo = "good morning\n"; | 31 | const foo = "good morning\n"; |
| 32 | const bar = "good evening\n"; | 32 | const bar = "good evening\n"; |
| ... | @@ -36,7 +36,7 @@ const bar = "good evening\n"; | ... | @@ -36,7 +36,7 @@ const bar = "good evening\n"; |
| 36 | #file=main.zig | 36 | #file=main.zig |
| 37 | const std = @import("std"); | 37 | const std = @import("std"); |
| 38 | pub fn main() !void { | 38 | pub fn main() !void { |
| 39 | try std.fs.File.stdout().writeAll(qux); | 39 | try std.Io.File.stdout().writeAll(qux); |
| 40 | } | 40 | } |
| 41 | const foo = "good morning\n"; | 41 | const foo = "good morning\n"; |
| 42 | const bar = "good evening\n"; | 42 | const bar = "good evening\n"; |
| ... | @@ -46,7 +46,7 @@ const bar = "good evening\n"; | ... | @@ -46,7 +46,7 @@ const bar = "good evening\n"; |
| 46 | #file=main.zig | 46 | #file=main.zig |
| 47 | const std = @import("std"); | 47 | const std = @import("std"); |
| 48 | pub fn main() !void { | 48 | pub fn main() !void { |
| 49 | try std.fs.File.stdout().writeAll(qux); | 49 | try std.Io.File.stdout().writeAll(qux); |
| 50 | } | 50 | } |
| 51 | const foo = "good morning\n"; | 51 | const foo = "good morning\n"; |
| 52 | const bar = "good evening\n"; | 52 | const bar = "good evening\n"; |
| ... | @@ -57,7 +57,7 @@ const qux = "good night\n"; | ... | @@ -57,7 +57,7 @@ const qux = "good night\n"; |
| 57 | #file=main.zig | 57 | #file=main.zig |
| 58 | const std = @import("std"); | 58 | const std = @import("std"); |
| 59 | pub fn main() !void { | 59 | pub fn main() !void { |
| 60 | try std.fs.File.stdout().writeAll(qux); | 60 | try std.Io.File.stdout().writeAll(qux); |
| 61 | } | 61 | } |
| 62 | const qux = "good night\n"; | 62 | const qux = "good night\n"; |
| 63 | #expect_stdout="good night\n" | 63 | #expect_stdout="good night\n" |
test/incremental/add_decl_namespaced+6-6| ... | @@ -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 | try std.fs.File.stdout().writeAll(@This().foo); | 10 | try std.Io.File.stdout().writeAll(@This().foo); |
| 11 | } | 11 | } |
| 12 | const foo = "good morning\n"; | 12 | const foo = "good morning\n"; |
| 13 | #expect_stdout="good morning\n" | 13 | #expect_stdout="good morning\n" |
| ... | @@ -16,7 +16,7 @@ const foo = "good morning\n"; | ... | @@ -16,7 +16,7 @@ const foo = "good morning\n"; |
| 16 | #file=main.zig | 16 | #file=main.zig |
| 17 | const std = @import("std"); | 17 | const std = @import("std"); |
| 18 | pub fn main() !void { | 18 | pub fn main() !void { |
| 19 | try std.fs.File.stdout().writeAll(@This().foo); | 19 | try std.Io.File.stdout().writeAll(@This().foo); |
| 20 | } | 20 | } |
| 21 | const foo = "good morning\n"; | 21 | const foo = "good morning\n"; |
| 22 | const bar = "good evening\n"; | 22 | const bar = "good evening\n"; |
| ... | @@ -26,7 +26,7 @@ const bar = "good evening\n"; | ... | @@ -26,7 +26,7 @@ const bar = "good evening\n"; |
| 26 | #file=main.zig | 26 | #file=main.zig |
| 27 | const std = @import("std"); | 27 | const std = @import("std"); |
| 28 | pub fn main() !void { | 28 | pub fn main() !void { |
| 29 | try std.fs.File.stdout().writeAll(@This().bar); | 29 | try std.Io.File.stdout().writeAll(@This().bar); |
| 30 | } | 30 | } |
| 31 | const foo = "good morning\n"; | 31 | const foo = "good morning\n"; |
| 32 | const bar = "good evening\n"; | 32 | const bar = "good evening\n"; |
| ... | @@ -36,7 +36,7 @@ const bar = "good evening\n"; | ... | @@ -36,7 +36,7 @@ const bar = "good evening\n"; |
| 36 | #file=main.zig | 36 | #file=main.zig |
| 37 | const std = @import("std"); | 37 | const std = @import("std"); |
| 38 | pub fn main() !void { | 38 | pub fn main() !void { |
| 39 | try std.fs.File.stdout().writeAll(@This().qux); | 39 | try std.Io.File.stdout().writeAll(@This().qux); |
| 40 | } | 40 | } |
| 41 | const foo = "good morning\n"; | 41 | const foo = "good morning\n"; |
| 42 | const bar = "good evening\n"; | 42 | const bar = "good evening\n"; |
| ... | @@ -47,7 +47,7 @@ const bar = "good evening\n"; | ... | @@ -47,7 +47,7 @@ const bar = "good evening\n"; |
| 47 | #file=main.zig | 47 | #file=main.zig |
| 48 | const std = @import("std"); | 48 | const std = @import("std"); |
| 49 | pub fn main() !void { | 49 | pub fn main() !void { |
| 50 | try std.fs.File.stdout().writeAll(@This().qux); | 50 | try std.Io.File.stdout().writeAll(@This().qux); |
| 51 | } | 51 | } |
| 52 | const foo = "good morning\n"; | 52 | const foo = "good morning\n"; |
| 53 | const bar = "good evening\n"; | 53 | const bar = "good evening\n"; |
| ... | @@ -58,7 +58,7 @@ const qux = "good night\n"; | ... | @@ -58,7 +58,7 @@ const qux = "good night\n"; |
| 58 | #file=main.zig | 58 | #file=main.zig |
| 59 | const std = @import("std"); | 59 | const std = @import("std"); |
| 60 | pub fn main() !void { | 60 | pub fn main() !void { |
| 61 | try std.fs.File.stdout().writeAll(@This().qux); | 61 | try std.Io.File.stdout().writeAll(@This().qux); |
| 62 | } | 62 | } |
| 63 | const qux = "good night\n"; | 63 | const qux = "good night\n"; |
| 64 | #expect_stdout="good night\n" | 64 | #expect_stdout="good night\n" |
test/incremental/bad_import+2-2| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 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.fs.File.stdout().writeAll("success\n"); | 11 | try std.Io.File.stdout().writeAll("success\n"); |
| 12 | } | 12 | } |
| 13 | const std = @import("std"); | 13 | const std = @import("std"); |
| 14 | #file=foo.zig | 14 | #file=foo.zig |
| ... | @@ -30,7 +30,7 @@ comptime { | ... | @@ -30,7 +30,7 @@ comptime { |
| 30 | #file=main.zig | 30 | #file=main.zig |
| 31 | pub fn main() !void { | 31 | pub fn main() !void { |
| 32 | //_ = @import("foo.zig"); | 32 | //_ = @import("foo.zig"); |
| 33 | try std.fs.File.stdout().writeAll("success\n"); | 33 | try std.Io.File.stdout().writeAll("success\n"); |
| 34 | } | 34 | } |
| 35 | const std = @import("std"); | 35 | const std = @import("std"); |
| 36 | #expect_stdout="success\n" | 36 | #expect_stdout="success\n" |
test/incremental/change_embed_file+3-3| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 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.fs.File.stdout().writeAll(string); | 11 | try std.Io.File.stdout().writeAll(string); |
| 12 | } | 12 | } |
| 13 | #file=string.txt | 13 | #file=string.txt |
| 14 | Hello, World! | 14 | Hello, World! |
| ... | @@ -28,7 +28,7 @@ Hello again, World! | ... | @@ -28,7 +28,7 @@ Hello again, World! |
| 28 | const std = @import("std"); | 28 | const std = @import("std"); |
| 29 | const string = @embedFile("string.txt"); | 29 | const string = @embedFile("string.txt"); |
| 30 | pub fn main() !void { | 30 | pub fn main() !void { |
| 31 | try std.fs.File.stdout().writeAll("a hardcoded string\n"); | 31 | try std.Io.File.stdout().writeAll("a hardcoded string\n"); |
| 32 | } | 32 | } |
| 33 | #expect_stdout="a hardcoded string\n" | 33 | #expect_stdout="a hardcoded string\n" |
| 34 | 34 | ||
| ... | @@ -37,7 +37,7 @@ pub fn main() !void { | ... | @@ -37,7 +37,7 @@ pub fn main() !void { |
| 37 | const std = @import("std"); | 37 | const std = @import("std"); |
| 38 | const string = @embedFile("string.txt"); | 38 | const string = @embedFile("string.txt"); |
| 39 | pub fn main() !void { | 39 | pub fn main() !void { |
| 40 | try std.fs.File.stdout().writeAll(string); | 40 | try std.Io.File.stdout().writeAll(string); |
| 41 | } | 41 | } |
| 42 | #expect_error=main.zig:2:27: error: unable to open 'string.txt': FileNotFound | 42 | #expect_error=main.zig:2:27: error: unable to open 'string.txt': FileNotFound |
| 43 | 43 |
test/incremental/change_enum_tag_type+3-3| ... | @@ -15,7 +15,7 @@ const Foo = enum(Tag) { | ... | @@ -15,7 +15,7 @@ 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.fs.File.stdout().writerStreaming(&.{}); | 18 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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"); |
| ... | @@ -33,7 +33,7 @@ const Foo = enum(Tag) { | ... | @@ -33,7 +33,7 @@ const Foo = enum(Tag) { |
| 33 | pub fn main() !void { | 33 | pub fn main() !void { |
| 34 | var val: Foo = undefined; | 34 | var val: Foo = undefined; |
| 35 | val = .a; | 35 | val = .a; |
| 36 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 36 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 37 | try stdout_writer.interface.print("{s}\n", .{@tagName(val)}); | 37 | try stdout_writer.interface.print("{s}\n", .{@tagName(val)}); |
| 38 | } | 38 | } |
| 39 | comptime { | 39 | comptime { |
| ... | @@ -56,7 +56,7 @@ const Foo = enum(Tag) { | ... | @@ -56,7 +56,7 @@ const Foo = enum(Tag) { |
| 56 | pub fn main() !void { | 56 | pub fn main() !void { |
| 57 | var val: Foo = undefined; | 57 | var val: Foo = undefined; |
| 58 | val = .a; | 58 | val = .a; |
| 59 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 59 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 60 | try stdout_writer.interface.print("{s}\n", .{@tagName(val)}); | 60 | try stdout_writer.interface.print("{s}\n", .{@tagName(val)}); |
| 61 | } | 61 | } |
| 62 | const std = @import("std"); | 62 | const std = @import("std"); |
test/incremental/change_exports+6-6| ... | @@ -17,7 +17,7 @@ pub fn main() !void { | ... | @@ -17,7 +17,7 @@ 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.fs.File.stdout().writerStreaming(&.{}); | 20 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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"); |
| ... | @@ -39,7 +39,7 @@ pub fn main() !void { | ... | @@ -39,7 +39,7 @@ pub fn main() !void { |
| 39 | extern const other: u32; | 39 | extern const other: u32; |
| 40 | }; | 40 | }; |
| 41 | S.foo(); | 41 | S.foo(); |
| 42 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 42 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 43 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); | 43 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 44 | } | 44 | } |
| 45 | const std = @import("std"); | 45 | const std = @import("std"); |
| ... | @@ -62,7 +62,7 @@ pub fn main() !void { | ... | @@ -62,7 +62,7 @@ pub fn main() !void { |
| 62 | extern const other: u32; | 62 | extern const other: u32; |
| 63 | }; | 63 | }; |
| 64 | S.foo(); | 64 | S.foo(); |
| 65 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 65 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 66 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); | 66 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 67 | } | 67 | } |
| 68 | const std = @import("std"); | 68 | const std = @import("std"); |
| ... | @@ -87,7 +87,7 @@ pub fn main() !void { | ... | @@ -87,7 +87,7 @@ pub fn main() !void { |
| 87 | extern const other: u32; | 87 | extern const other: u32; |
| 88 | }; | 88 | }; |
| 89 | S.foo(); | 89 | S.foo(); |
| 90 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 90 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 91 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); | 91 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 92 | } | 92 | } |
| 93 | const std = @import("std"); | 93 | const std = @import("std"); |
| ... | @@ -133,7 +133,7 @@ pub fn main() !void { | ... | @@ -133,7 +133,7 @@ pub fn main() !void { |
| 133 | extern const other: u32; | 133 | extern const other: u32; |
| 134 | }; | 134 | }; |
| 135 | S.foo(); | 135 | S.foo(); |
| 136 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 136 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 137 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); | 137 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 138 | } | 138 | } |
| 139 | const std = @import("std"); | 139 | const std = @import("std"); |
| ... | @@ -158,7 +158,7 @@ pub fn main() !void { | ... | @@ -158,7 +158,7 @@ pub fn main() !void { |
| 158 | extern const other: u32; | 158 | extern const other: u32; |
| 159 | }; | 159 | }; |
| 160 | S.foo(); | 160 | S.foo(); |
| 161 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 161 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 162 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); | 162 | try stdout_writer.interface.print("{} {}\n", .{ S.bar, S.other }); |
| 163 | } | 163 | } |
| 164 | const std = @import("std"); | 164 | const std = @import("std"); |
test/incremental/change_fn_type+3-3| ... | @@ -8,7 +8,7 @@ pub fn main() !void { | ... | @@ -8,7 +8,7 @@ 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.fs.File.stdout().writerStreaming(&.{}); | 11 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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"); |
| ... | @@ -20,7 +20,7 @@ pub fn main() !void { | ... | @@ -20,7 +20,7 @@ pub fn main() !void { |
| 20 | try foo(123); | 20 | try foo(123); |
| 21 | } | 21 | } |
| 22 | fn foo(x: i64) !void { | 22 | fn foo(x: i64) !void { |
| 23 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 23 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 24 | return stdout_writer.interface.print("{d}\n", .{x}); | 24 | return stdout_writer.interface.print("{d}\n", .{x}); |
| 25 | } | 25 | } |
| 26 | const std = @import("std"); | 26 | const std = @import("std"); |
| ... | @@ -32,7 +32,7 @@ pub fn main() !void { | ... | @@ -32,7 +32,7 @@ pub fn main() !void { |
| 32 | try foo(-42); | 32 | try foo(-42); |
| 33 | } | 33 | } |
| 34 | fn foo(x: i64) !void { | 34 | fn foo(x: i64) !void { |
| 35 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 35 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 36 | return stdout_writer.interface.print("{d}\n", .{x}); | 36 | return stdout_writer.interface.print("{d}\n", .{x}); |
| 37 | } | 37 | } |
| 38 | const std = @import("std"); | 38 | const std = @import("std"); |
test/incremental/change_generic_line_number+2-2| ... | @@ -7,7 +7,7 @@ const std = @import("std"); | ... | @@ -7,7 +7,7 @@ const std = @import("std"); |
| 7 | fn Printer(message: []const u8) type { | 7 | fn Printer(message: []const u8) type { |
| 8 | return struct { | 8 | return struct { |
| 9 | fn print() !void { | 9 | fn print() !void { |
| 10 | try std.fs.File.stdout().writeAll(message); | 10 | try std.Io.File.stdout().writeAll(message); |
| 11 | } | 11 | } |
| 12 | }; | 12 | }; |
| 13 | } | 13 | } |
| ... | @@ -23,7 +23,7 @@ const std = @import("std"); | ... | @@ -23,7 +23,7 @@ const std = @import("std"); |
| 23 | fn Printer(message: []const u8) type { | 23 | fn Printer(message: []const u8) type { |
| 24 | return struct { | 24 | return struct { |
| 25 | fn print() !void { | 25 | fn print() !void { |
| 26 | try std.fs.File.stdout().writeAll(message); | 26 | try std.Io.File.stdout().writeAll(message); |
| 27 | } | 27 | } |
| 28 | }; | 28 | }; |
| 29 | } | 29 | } |
test/incremental/change_line_number+2-2| ... | @@ -5,7 +5,7 @@ | ... | @@ -5,7 +5,7 @@ |
| 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.fs.File.stdout().writeAll("foo\n"); | 8 | try std.Io.File.stdout().writeAll("foo\n"); |
| 9 | } | 9 | } |
| 10 | #expect_stdout="foo\n" | 10 | #expect_stdout="foo\n" |
| 11 | #update=change line number | 11 | #update=change line number |
| ... | @@ -13,6 +13,6 @@ pub fn main() !void { | ... | @@ -13,6 +13,6 @@ pub fn main() !void { |
| 13 | const std = @import("std"); | 13 | const std = @import("std"); |
| 14 | 14 | ||
| 15 | pub fn main() !void { | 15 | pub fn main() !void { |
| 16 | try std.fs.File.stdout().writeAll("foo\n"); | 16 | try std.Io.File.stdout().writeAll("foo\n"); |
| 17 | } | 17 | } |
| 18 | #expect_stdout="foo\n" | 18 | #expect_stdout="foo\n" |
test/incremental/change_panic_handler+3-3| ... | @@ -12,7 +12,7 @@ pub fn main() !u8 { | ... | @@ -12,7 +12,7 @@ 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.fs.File.stdout().writerStreaming(&.{}); | 15 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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 | } |
| ... | @@ -29,7 +29,7 @@ pub fn main() !u8 { | ... | @@ -29,7 +29,7 @@ pub fn main() !u8 { |
| 29 | } | 29 | } |
| 30 | pub const panic = std.debug.FullPanic(myPanic); | 30 | pub const panic = std.debug.FullPanic(myPanic); |
| 31 | fn myPanic(msg: []const u8, _: ?usize) noreturn { | 31 | fn myPanic(msg: []const u8, _: ?usize) noreturn { |
| 32 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 32 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 33 | stdout_writer.interface.print("new panic message: {s}\n", .{msg}) catch {}; | 33 | stdout_writer.interface.print("new panic message: {s}\n", .{msg}) catch {}; |
| 34 | std.process.exit(0); | 34 | std.process.exit(0); |
| 35 | } | 35 | } |
| ... | @@ -46,7 +46,7 @@ pub fn main() !u8 { | ... | @@ -46,7 +46,7 @@ pub fn main() !u8 { |
| 46 | } | 46 | } |
| 47 | pub const panic = std.debug.FullPanic(myPanicNew); | 47 | pub const panic = std.debug.FullPanic(myPanicNew); |
| 48 | fn myPanicNew(msg: []const u8, _: ?usize) noreturn { | 48 | fn myPanicNew(msg: []const u8, _: ?usize) noreturn { |
| 49 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 49 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 50 | stdout_writer.interface.print("third panic message: {s}\n", .{msg}) catch {}; | 50 | stdout_writer.interface.print("third panic message: {s}\n", .{msg}) catch {}; |
| 51 | std.process.exit(0); | 51 | std.process.exit(0); |
| 52 | } | 52 | } |
test/incremental/change_panic_handler_explicit+3-3| ... | @@ -42,7 +42,7 @@ pub const panic = struct { | ... | @@ -42,7 +42,7 @@ 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.fs.File.stdout().writerStreaming(&.{}); | 45 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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 | } |
| ... | @@ -89,7 +89,7 @@ pub const panic = struct { | ... | @@ -89,7 +89,7 @@ pub const panic = struct { |
| 89 | pub const noreturnReturned = no_panic.noreturnReturned; | 89 | pub const noreturnReturned = no_panic.noreturnReturned; |
| 90 | }; | 90 | }; |
| 91 | fn myPanic(msg: []const u8, _: ?usize) noreturn { | 91 | fn myPanic(msg: []const u8, _: ?usize) noreturn { |
| 92 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 92 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 93 | stdout_writer.interface.print("new panic message: {s}\n", .{msg}) catch {}; | 93 | stdout_writer.interface.print("new panic message: {s}\n", .{msg}) catch {}; |
| 94 | std.process.exit(0); | 94 | std.process.exit(0); |
| 95 | } | 95 | } |
| ... | @@ -136,7 +136,7 @@ pub const panic = struct { | ... | @@ -136,7 +136,7 @@ pub const panic = struct { |
| 136 | pub const noreturnReturned = no_panic.noreturnReturned; | 136 | pub const noreturnReturned = no_panic.noreturnReturned; |
| 137 | }; | 137 | }; |
| 138 | fn myPanicNew(msg: []const u8, _: ?usize) noreturn { | 138 | fn myPanicNew(msg: []const u8, _: ?usize) noreturn { |
| 139 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 139 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 140 | stdout_writer.interface.print("third panic message: {s}\n", .{msg}) catch {}; | 140 | stdout_writer.interface.print("third panic message: {s}\n", .{msg}) catch {}; |
| 141 | std.process.exit(0); | 141 | std.process.exit(0); |
| 142 | } | 142 | } |
test/incremental/change_shift_op+2-2| ... | @@ -9,7 +9,7 @@ pub fn main() !void { | ... | @@ -9,7 +9,7 @@ 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.fs.File.stdout().writerStreaming(&.{}); | 12 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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"); |
| ... | @@ -20,7 +20,7 @@ pub fn main() !void { | ... | @@ -20,7 +20,7 @@ pub fn main() !void { |
| 20 | try foo(0x1300); | 20 | try foo(0x1300); |
| 21 | } | 21 | } |
| 22 | fn foo(x: u16) !void { | 22 | fn foo(x: u16) !void { |
| 23 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 23 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 24 | try stdout_writer.interface.print("0x{x}\n", .{x >> 4}); | 24 | try stdout_writer.interface.print("0x{x}\n", .{x >> 4}); |
| 25 | } | 25 | } |
| 26 | const std = @import("std"); | 26 | const std = @import("std"); |
test/incremental/change_struct_same_fields+3-3| ... | @@ -11,7 +11,7 @@ pub fn main() !void { | ... | @@ -11,7 +11,7 @@ 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.fs.File.stdout().writerStreaming(&.{}); | 14 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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 }, |
| ... | @@ -28,7 +28,7 @@ pub fn main() !void { | ... | @@ -28,7 +28,7 @@ pub fn main() !void { |
| 28 | try foo(&val); | 28 | try foo(&val); |
| 29 | } | 29 | } |
| 30 | fn foo(val: *const S) !void { | 30 | fn foo(val: *const S) !void { |
| 31 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 31 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 32 | try stdout_writer.interface.print( | 32 | try stdout_writer.interface.print( |
| 33 | "{d} {d}\n", | 33 | "{d} {d}\n", |
| 34 | .{ val.x, val.y }, | 34 | .{ val.x, val.y }, |
| ... | @@ -45,7 +45,7 @@ pub fn main() !void { | ... | @@ -45,7 +45,7 @@ pub fn main() !void { |
| 45 | try foo(&val); | 45 | try foo(&val); |
| 46 | } | 46 | } |
| 47 | fn foo(val: *const S) !void { | 47 | fn foo(val: *const S) !void { |
| 48 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 48 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 49 | try stdout_writer.interface.print( | 49 | try stdout_writer.interface.print( |
| 50 | "{d} {d}\n", | 50 | "{d} {d}\n", |
| 51 | .{ val.x, val.y }, | 51 | .{ val.x, val.y }, |
test/incremental/change_zon_file+3-3| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 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.fs.File.stdout().writeAll(message); | 11 | try std.Io.File.stdout().writeAll(message); |
| 12 | } | 12 | } |
| 13 | #file=message.zon | 13 | #file=message.zon |
| 14 | "Hello, World!\n" | 14 | "Hello, World!\n" |
| ... | @@ -29,7 +29,7 @@ pub fn main() !void { | ... | @@ -29,7 +29,7 @@ pub fn main() !void { |
| 29 | const std = @import("std"); | 29 | const std = @import("std"); |
| 30 | const message: []const u8 = @import("message.zon"); | 30 | const message: []const u8 = @import("message.zon"); |
| 31 | pub fn main() !void { | 31 | pub fn main() !void { |
| 32 | try std.fs.File.stdout().writeAll("a hardcoded string\n"); | 32 | try std.Io.File.stdout().writeAll("a hardcoded string\n"); |
| 33 | } | 33 | } |
| 34 | #expect_error=message.zon:1:1: error: unable to load 'message.zon': FileNotFound | 34 | #expect_error=message.zon:1:1: error: unable to load 'message.zon': FileNotFound |
| 35 | #expect_error=main.zig:2:37: note: file imported here | 35 | #expect_error=main.zig:2:37: note: file imported here |
| ... | @@ -44,6 +44,6 @@ pub fn main() !void { | ... | @@ -44,6 +44,6 @@ pub fn main() !void { |
| 44 | const std = @import("std"); | 44 | const std = @import("std"); |
| 45 | const message: []const u8 = @import("message.zon"); | 45 | const message: []const u8 = @import("message.zon"); |
| 46 | pub fn main() !void { | 46 | pub fn main() !void { |
| 47 | try std.fs.File.stdout().writeAll(message); | 47 | try std.Io.File.stdout().writeAll(message); |
| 48 | } | 48 | } |
| 49 | #expect_stdout="We're back, World!\n" | 49 | #expect_stdout="We're back, World!\n" |
test/incremental/change_zon_file_no_result_type+1-1| ... | @@ -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 | try std.fs.File.stdout().writeAll(@import("foo.zon").message); | 10 | try std.Io.File.stdout().writeAll(@import("foo.zon").message); |
| 11 | } | 11 | } |
| 12 | #file=foo.zon | 12 | #file=foo.zon |
| 13 | .{ | 13 | .{ |
test/incremental/compile_log+3-3| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 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.fs.File.stdout().writeAll("Hello, World!\n"); | 11 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 12 | } | 12 | } |
| 13 | #expect_stdout="Hello, World!\n" | 13 | #expect_stdout="Hello, World!\n" |
| 14 | 14 | ||
| ... | @@ -16,7 +16,7 @@ pub fn main() !void { | ... | @@ -16,7 +16,7 @@ pub fn main() !void { |
| 16 | #file=main.zig | 16 | #file=main.zig |
| 17 | const std = @import("std"); | 17 | const std = @import("std"); |
| 18 | pub fn main() !void { | 18 | pub fn main() !void { |
| 19 | try std.fs.File.stdout().writeAll("Hello, World!\n"); | 19 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 20 | @compileLog("this is a log"); | 20 | @compileLog("this is a log"); |
| 21 | } | 21 | } |
| 22 | #expect_error=main.zig:4:5: error: found compile log statement | 22 | #expect_error=main.zig:4:5: error: found compile log statement |
| ... | @@ -26,6 +26,6 @@ pub fn main() !void { | ... | @@ -26,6 +26,6 @@ pub fn main() !void { |
| 26 | #file=main.zig | 26 | #file=main.zig |
| 27 | const std = @import("std"); | 27 | const std = @import("std"); |
| 28 | pub fn main() !void { | 28 | pub fn main() !void { |
| 29 | try std.fs.File.stdout().writeAll("Hello, World!\n"); | 29 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 30 | } | 30 | } |
| 31 | #expect_stdout="Hello, World!\n" | 31 | #expect_stdout="Hello, World!\n" |
test/incremental/fix_astgen_failure+4-4| ... | @@ -10,21 +10,21 @@ pub fn main() !void { | ... | @@ -10,21 +10,21 @@ 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.fs.File.stdout().writeAll("Hello, World!\n"); | 13 | try std.Io.File.stdout().writeAll("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.fs.File.stdout().writeAll("Hello, World!\n"); | 20 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 21 | } | 21 | } |
| 22 | #expect_stdout="Hello, World!\n" | 22 | #expect_stdout="Hello, World!\n" |
| 23 | #update=add new error | 23 | #update=add new error |
| 24 | #file=foo.zig | 24 | #file=foo.zig |
| 25 | const std = @import("std"); | 25 | const std = @import("std"); |
| 26 | pub fn hello() !void { | 26 | pub fn hello() !void { |
| 27 | try std.fs.File.stdout().writeAll(hello_str); | 27 | try std.Io.File.stdout().writeAll(hello_str); |
| 28 | } | 28 | } |
| 29 | #expect_error=foo.zig:3:39: error: use of undeclared identifier 'hello_str' | 29 | #expect_error=foo.zig:3:39: error: use of undeclared identifier 'hello_str' |
| 30 | #update=fix the new error | 30 | #update=fix the new error |
| ... | @@ -32,6 +32,6 @@ pub fn hello() !void { | ... | @@ -32,6 +32,6 @@ pub fn hello() !void { |
| 32 | const std = @import("std"); | 32 | const std = @import("std"); |
| 33 | const hello_str = "Hello, World! Again!\n"; | 33 | const hello_str = "Hello, World! Again!\n"; |
| 34 | pub fn hello() !void { | 34 | pub fn hello() !void { |
| 35 | try std.fs.File.stdout().writeAll(hello_str); | 35 | try std.Io.File.stdout().writeAll(hello_str); |
| 36 | } | 36 | } |
| 37 | #expect_stdout="Hello, World! Again!\n" | 37 | #expect_stdout="Hello, World! Again!\n" |
test/incremental/function_becomes_inline+3-3| ... | @@ -8,7 +8,7 @@ pub fn main() !void { | ... | @@ -8,7 +8,7 @@ pub fn main() !void { |
| 8 | try foo(); | 8 | try foo(); |
| 9 | } | 9 | } |
| 10 | fn foo() !void { | 10 | fn foo() !void { |
| 11 | try std.fs.File.stdout().writeAll("Hello, World!\n"); | 11 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 12 | } | 12 | } |
| 13 | const std = @import("std"); | 13 | const std = @import("std"); |
| 14 | #expect_stdout="Hello, World!\n" | 14 | #expect_stdout="Hello, World!\n" |
| ... | @@ -19,7 +19,7 @@ pub fn main() !void { | ... | @@ -19,7 +19,7 @@ pub fn main() !void { |
| 19 | try foo(); | 19 | try foo(); |
| 20 | } | 20 | } |
| 21 | inline fn foo() !void { | 21 | inline fn foo() !void { |
| 22 | try std.fs.File.stdout().writeAll("Hello, World!\n"); | 22 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 23 | } | 23 | } |
| 24 | const std = @import("std"); | 24 | const std = @import("std"); |
| 25 | #expect_stdout="Hello, World!\n" | 25 | #expect_stdout="Hello, World!\n" |
| ... | @@ -30,7 +30,7 @@ pub fn main() !void { | ... | @@ -30,7 +30,7 @@ pub fn main() !void { |
| 30 | try foo(); | 30 | try foo(); |
| 31 | } | 31 | } |
| 32 | inline fn foo() !void { | 32 | inline fn foo() !void { |
| 33 | try std.fs.File.stdout().writeAll("Hello, `inline` World!\n"); | 33 | try std.Io.File.stdout().writeAll("Hello, `inline` World!\n"); |
| 34 | } | 34 | } |
| 35 | const std = @import("std"); | 35 | const std = @import("std"); |
| 36 | #expect_stdout="Hello, `inline` World!\n" | 36 | #expect_stdout="Hello, `inline` World!\n" |
test/incremental/hello+2-2| ... | @@ -7,13 +7,13 @@ | ... | @@ -7,13 +7,13 @@ |
| 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.fs.File.stdout().writeAll("good morning\n"); | 10 | try std.Io.File.stdout().writeAll("good morning\n"); |
| 11 | } | 11 | } |
| 12 | #expect_stdout="good morning\n" | 12 | #expect_stdout="good morning\n" |
| 13 | #update=change the string | 13 | #update=change the string |
| 14 | #file=main.zig | 14 | #file=main.zig |
| 15 | const std = @import("std"); | 15 | const std = @import("std"); |
| 16 | pub fn main() !void { | 16 | pub fn main() !void { |
| 17 | try std.fs.File.stdout().writeAll("おはようございます\n"); | 17 | try std.Io.File.stdout().writeAll("おはようございます\n"); |
| 18 | } | 18 | } |
| 19 | #expect_stdout="おはようございます\n" | 19 | #expect_stdout="おはようございます\n" |
test/incremental/make_decl_pub+2-2| ... | @@ -12,7 +12,7 @@ pub fn main() !void { | ... | @@ -12,7 +12,7 @@ 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.fs.File.stdout().writeAll("Hello, World!\n"); | 15 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 16 | } | 16 | } |
| 17 | #expect_error=main.zig:3:12: error: 'hello' is not marked 'pub' | 17 | #expect_error=main.zig:3:12: error: 'hello' is not marked 'pub' |
| 18 | #expect_error=foo.zig:2:1: note: declared here | 18 | #expect_error=foo.zig:2:1: note: declared here |
| ... | @@ -21,6 +21,6 @@ fn hello() !void { | ... | @@ -21,6 +21,6 @@ fn hello() !void { |
| 21 | #file=foo.zig | 21 | #file=foo.zig |
| 22 | const std = @import("std"); | 22 | const std = @import("std"); |
| 23 | pub fn hello() !void { | 23 | pub fn hello() !void { |
| 24 | try std.fs.File.stdout().writeAll("Hello, World!\n"); | 24 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 25 | } | 25 | } |
| 26 | #expect_stdout="Hello, World!\n" | 26 | #expect_stdout="Hello, World!\n" |
test/incremental/modify_inline_fn+2-2| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 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.fs.File.stdout().writeAll(str); | 11 | try std.Io.File.stdout().writeAll(str); |
| 12 | } | 12 | } |
| 13 | inline fn getStr() []const u8 { | 13 | inline fn getStr() []const u8 { |
| 14 | return "foo\n"; | 14 | return "foo\n"; |
| ... | @@ -19,7 +19,7 @@ inline fn getStr() []const u8 { | ... | @@ -19,7 +19,7 @@ inline fn getStr() []const u8 { |
| 19 | const std = @import("std"); | 19 | const std = @import("std"); |
| 20 | pub fn main() !void { | 20 | pub fn main() !void { |
| 21 | const str = getStr(); | 21 | const str = getStr(); |
| 22 | try std.fs.File.stdout().writeAll(str); | 22 | try std.Io.File.stdout().writeAll(str); |
| 23 | } | 23 | } |
| 24 | inline fn getStr() []const u8 { | 24 | inline fn getStr() []const u8 { |
| 25 | return "bar\n"; | 25 | return "bar\n"; |
test/incremental/move_src+2-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.fs.File.stdout().writerStreaming(&.{}); | 10 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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 { |
| ... | @@ -22,7 +22,7 @@ fn bar() u32 { | ... | @@ -22,7 +22,7 @@ fn bar() u32 { |
| 22 | #file=main.zig | 22 | #file=main.zig |
| 23 | const std = @import("std"); | 23 | const std = @import("std"); |
| 24 | pub fn main() !void { | 24 | pub fn main() !void { |
| 25 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 25 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 26 | try stdout_writer.interface.print("{d} {d}\n", .{ foo(), bar() }); | 26 | try stdout_writer.interface.print("{d} {d}\n", .{ foo(), bar() }); |
| 27 | } | 27 | } |
| 28 | 28 |
test/incremental/no_change_preserves_tag_names+2-2| ... | @@ -8,7 +8,7 @@ | ... | @@ -8,7 +8,7 @@ |
| 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 | pub fn main() !void { | 10 | pub fn main() !void { |
| 11 | try std.fs.File.stdout().writeAll(@tagName(some_enum)); | 11 | try std.Io.File.stdout().writeAll(@tagName(some_enum)); |
| 12 | } | 12 | } |
| 13 | #expect_stdout="first" | 13 | #expect_stdout="first" |
| 14 | #update=no change | 14 | #update=no change |
| ... | @@ -16,6 +16,6 @@ pub fn main() !void { | ... | @@ -16,6 +16,6 @@ pub fn main() !void { |
| 16 | const std = @import("std"); | 16 | const std = @import("std"); |
| 17 | var some_enum: enum { first, second } = .first; | 17 | var some_enum: enum { first, second } = .first; |
| 18 | pub fn main() !void { | 18 | pub fn main() !void { |
| 19 | try std.fs.File.stdout().writeAll(@tagName(some_enum)); | 19 | try std.Io.File.stdout().writeAll(@tagName(some_enum)); |
| 20 | } | 20 | } |
| 21 | #expect_stdout="first" | 21 | #expect_stdout="first" |
test/incremental/recursive_function_becomes_non_recursive+2-2| ... | @@ -9,7 +9,7 @@ pub fn main() !void { | ... | @@ -9,7 +9,7 @@ pub fn main() !void { |
| 9 | try foo(false); | 9 | try foo(false); |
| 10 | } | 10 | } |
| 11 | fn foo(recurse: bool) !void { | 11 | fn foo(recurse: bool) !void { |
| 12 | const stdout = std.fs.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.writeAll("non-recursive path\n"); |
| 15 | } | 15 | } |
| ... | @@ -22,7 +22,7 @@ pub fn main() !void { | ... | @@ -22,7 +22,7 @@ pub fn main() !void { |
| 22 | try foo(true); | 22 | try foo(true); |
| 23 | } | 23 | } |
| 24 | fn foo(recurse: bool) !void { | 24 | fn foo(recurse: bool) !void { |
| 25 | const stdout = std.fs.File.stdout(); | 25 | const stdout = std.Io.File.stdout(); |
| 26 | if (recurse) return stdout.writeAll("x==1\n"); | 26 | if (recurse) return stdout.writeAll("x==1\n"); |
| 27 | try stdout.writeAll("non-recursive path\n"); | 27 | try stdout.writeAll("non-recursive path\n"); |
| 28 | } | 28 | } |
test/incremental/remove_enum_field+2-2| ... | @@ -10,7 +10,7 @@ const MyEnum = enum(u8) { | ... | @@ -10,7 +10,7 @@ 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.fs.File.stdout().writerStreaming(&.{}); | 13 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 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"); |
| ... | @@ -22,7 +22,7 @@ const MyEnum = enum(u8) { | ... | @@ -22,7 +22,7 @@ const MyEnum = enum(u8) { |
| 22 | bar = 2, | 22 | bar = 2, |
| 23 | }; | 23 | }; |
| 24 | pub fn main() !void { | 24 | pub fn main() !void { |
| 25 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 25 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 26 | try stdout_writer.interface.print("{}\n", .{@intFromEnum(MyEnum.foo)}); | 26 | try stdout_writer.interface.print("{}\n", .{@intFromEnum(MyEnum.foo)}); |
| 27 | } | 27 | } |
| 28 | const std = @import("std"); | 28 | const std = @import("std"); |
test/incremental/unreferenced_error+4-4| ... | @@ -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 | try std.fs.File.stdout().writeAll(a); | 10 | try std.Io.File.stdout().writeAll(a); |
| 11 | } | 11 | } |
| 12 | const a = "Hello, World!\n"; | 12 | const a = "Hello, World!\n"; |
| 13 | #expect_stdout="Hello, World!\n" | 13 | #expect_stdout="Hello, World!\n" |
| ... | @@ -16,7 +16,7 @@ const a = "Hello, World!\n"; | ... | @@ -16,7 +16,7 @@ const a = "Hello, World!\n"; |
| 16 | #file=main.zig | 16 | #file=main.zig |
| 17 | const std = @import("std"); | 17 | const std = @import("std"); |
| 18 | pub fn main() !void { | 18 | pub fn main() !void { |
| 19 | try std.fs.File.stdout().writeAll(a); | 19 | try std.Io.File.stdout().writeAll(a); |
| 20 | } | 20 | } |
| 21 | const a = @compileError("bad a"); | 21 | const a = @compileError("bad a"); |
| 22 | #expect_error=main.zig:5:11: error: bad a | 22 | #expect_error=main.zig:5:11: error: bad a |
| ... | @@ -25,7 +25,7 @@ const a = @compileError("bad a"); | ... | @@ -25,7 +25,7 @@ const a = @compileError("bad a"); |
| 25 | #file=main.zig | 25 | #file=main.zig |
| 26 | const std = @import("std"); | 26 | const std = @import("std"); |
| 27 | pub fn main() !void { | 27 | pub fn main() !void { |
| 28 | try std.fs.File.stdout().writeAll(b); | 28 | try std.Io.File.stdout().writeAll(b); |
| 29 | } | 29 | } |
| 30 | const a = @compileError("bad a"); | 30 | const a = @compileError("bad a"); |
| 31 | const b = "Hi there!\n"; | 31 | const b = "Hi there!\n"; |
| ... | @@ -35,7 +35,7 @@ const b = "Hi there!\n"; | ... | @@ -35,7 +35,7 @@ const b = "Hi there!\n"; |
| 35 | #file=main.zig | 35 | #file=main.zig |
| 36 | const std = @import("std"); | 36 | const std = @import("std"); |
| 37 | pub fn main() !void { | 37 | pub fn main() !void { |
| 38 | try std.fs.File.stdout().writeAll(a); | 38 | try std.Io.File.stdout().writeAll(a); |
| 39 | } | 39 | } |
| 40 | const a = "Back to a\n"; | 40 | const a = "Back to a\n"; |
| 41 | const b = @compileError("bad b"); | 41 | const b = @compileError("bad b"); |
test/link/bss/main.zig+1-1| ... | @@ -4,7 +4,7 @@ const std = @import("std"); | ... | @@ -4,7 +4,7 @@ const std = @import("std"); |
| 4 | var buffer: [0x1000000]u64 = [1]u64{0} ** 0x1000000; | 4 | var buffer: [0x1000000]u64 = [1]u64{0} ** 0x1000000; |
| 5 | 5 | ||
| 6 | pub fn main() anyerror!void { | 6 | pub fn main() anyerror!void { |
| 7 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 7 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 8 | 8 | ||
| 9 | buffer[0x10] = 1; | 9 | buffer[0x10] = 1; |
| 10 | 10 |
test/link/elf.zig+2-2| ... | @@ -1323,7 +1323,7 @@ fn testGcSectionsZig(b: *Build, opts: Options) *Step { | ... | @@ -1323,7 +1323,7 @@ fn testGcSectionsZig(b: *Build, opts: Options) *Step { |
| 1323 | \\extern var live_var2: i32; | 1323 | \\extern var live_var2: i32; |
| 1324 | \\extern fn live_fn2() void; | 1324 | \\extern fn live_fn2() void; |
| 1325 | \\pub fn main() void { | 1325 | \\pub fn main() void { |
| 1326 | \\ var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 1326 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 1327 | \\ stdout_writer.interface.print("{d} {d}\n", .{ live_var1, live_var2 }) catch @panic("fail"); | 1327 | \\ stdout_writer.interface.print("{d} {d}\n", .{ live_var1, live_var2 }) catch @panic("fail"); |
| 1328 | \\ live_fn2(); | 1328 | \\ live_fn2(); |
| 1329 | \\} | 1329 | \\} |
| ... | @@ -1365,7 +1365,7 @@ fn testGcSectionsZig(b: *Build, opts: Options) *Step { | ... | @@ -1365,7 +1365,7 @@ fn testGcSectionsZig(b: *Build, opts: Options) *Step { |
| 1365 | \\extern var live_var2: i32; | 1365 | \\extern var live_var2: i32; |
| 1366 | \\extern fn live_fn2() void; | 1366 | \\extern fn live_fn2() void; |
| 1367 | \\pub fn main() void { | 1367 | \\pub fn main() void { |
| 1368 | \\ var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 1368 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 1369 | \\ stdout_writer.interface.print("{d} {d}\n", .{ live_var1, live_var2 }) catch @panic("fail"); | 1369 | \\ stdout_writer.interface.print("{d} {d}\n", .{ live_var1, live_var2 }) catch @panic("fail"); |
| 1370 | \\ live_fn2(); | 1370 | \\ live_fn2(); |
| 1371 | \\} | 1371 | \\} |
test/link/macho.zig+2-2| ... | @@ -716,7 +716,7 @@ fn testHelloZig(b: *Build, opts: Options) *Step { | ... | @@ -716,7 +716,7 @@ fn testHelloZig(b: *Build, opts: Options) *Step { |
| 716 | const exe = addExecutable(b, opts, .{ .name = "main", .zig_source_bytes = | 716 | const exe = addExecutable(b, opts, .{ .name = "main", .zig_source_bytes = |
| 717 | \\const std = @import("std"); | 717 | \\const std = @import("std"); |
| 718 | \\pub fn main() void { | 718 | \\pub fn main() void { |
| 719 | \\ std.fs.File.stdout().writeAll("Hello world!\n") catch @panic("fail"); | 719 | \\ std.Io.File.stdout().writeAll("Hello world!\n") catch @panic("fail"); |
| 720 | \\} | 720 | \\} |
| 721 | }); | 721 | }); |
| 722 | 722 | ||
| ... | @@ -2371,7 +2371,7 @@ fn testTlsZig(b: *Build, opts: Options) *Step { | ... | @@ -2371,7 +2371,7 @@ fn testTlsZig(b: *Build, opts: Options) *Step { |
| 2371 | \\threadlocal var x: i32 = 0; | 2371 | \\threadlocal var x: i32 = 0; |
| 2372 | \\threadlocal var y: i32 = -1; | 2372 | \\threadlocal var y: i32 = -1; |
| 2373 | \\pub fn main() void { | 2373 | \\pub fn main() void { |
| 2374 | \\ var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 2374 | \\ var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 2375 | \\ stdout_writer.interface.print("{d} {d}\n", .{x, y}) catch unreachable; | 2375 | \\ stdout_writer.interface.print("{d} {d}\n", .{x, y}) catch unreachable; |
| 2376 | \\ x -= 1; | 2376 | \\ x -= 1; |
| 2377 | \\ y += 1; | 2377 | \\ y += 1; |
test/link/wasm/extern/main.zig+1-1| ... | @@ -3,6 +3,6 @@ const std = @import("std"); | ... | @@ -3,6 +3,6 @@ const std = @import("std"); |
| 3 | extern const foo: u32; | 3 | extern const foo: u32; |
| 4 | 4 | ||
| 5 | pub fn main() void { | 5 | pub fn main() void { |
| 6 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 6 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 7 | stdout_writer.interface.print("Result: {d}", .{foo}) catch {}; | 7 | stdout_writer.interface.print("Result: {d}", .{foo}) catch {}; |
| 8 | } | 8 | } |
test/src/Cases.zig+4-2| ... | @@ -1,6 +1,8 @@ | ... | @@ -1,6 +1,8 @@ |
| 1 | const Cases = @This(); | 1 | const Cases = @This(); |
| 2 | const builtin = @import("builtin"); | 2 | const builtin = @import("builtin"); |
| 3 | |||
| 3 | const std = @import("std"); | 4 | const std = @import("std"); |
| 5 | const Io = std.Io; | ||
| 4 | const assert = std.debug.assert; | 6 | const assert = std.debug.assert; |
| 5 | const Allocator = std.mem.Allocator; | 7 | const Allocator = std.mem.Allocator; |
| 6 | const getExternalExecutor = std.zig.system.getExternalExecutor; | 8 | const getExternalExecutor = std.zig.system.getExternalExecutor; |
| ... | @@ -313,7 +315,7 @@ pub fn addCompile( | ... | @@ -313,7 +315,7 @@ pub fn addCompile( |
| 313 | /// Each file should include a test manifest as a contiguous block of comments at | 315 | /// Each file should include a test manifest as a contiguous block of comments at |
| 314 | /// the end of the file. The first line should be the test type, followed by a set of | 316 | /// the end of the file. The first line should be the test type, followed by a set of |
| 315 | /// key-value config values, followed by a blank line, then the expected output. | 317 | /// key-value config values, followed by a blank line, then the expected output. |
| 316 | pub fn addFromDir(ctx: *Cases, dir: std.fs.Dir, b: *std.Build) void { | 318 | pub fn addFromDir(ctx: *Cases, dir: Io.Dir, b: *std.Build) void { |
| 317 | var current_file: []const u8 = "none"; | 319 | var current_file: []const u8 = "none"; |
| 318 | ctx.addFromDirInner(dir, &current_file, b) catch |err| { | 320 | ctx.addFromDirInner(dir, &current_file, b) catch |err| { |
| 319 | std.debug.panicExtra( | 321 | std.debug.panicExtra( |
| ... | @@ -326,7 +328,7 @@ pub fn addFromDir(ctx: *Cases, dir: std.fs.Dir, b: *std.Build) void { | ... | @@ -326,7 +328,7 @@ pub fn addFromDir(ctx: *Cases, dir: std.fs.Dir, b: *std.Build) void { |
| 326 | 328 | ||
| 327 | fn addFromDirInner( | 329 | fn addFromDirInner( |
| 328 | ctx: *Cases, | 330 | ctx: *Cases, |
| 329 | iterable_dir: std.fs.Dir, | 331 | iterable_dir: Io.Dir, |
| 330 | /// This is kept up to date with the currently being processed file so | 332 | /// This is kept up to date with the currently being processed file so |
| 331 | /// that if any errors occur the caller knows it happened during this file. | 333 | /// that if any errors occur the caller knows it happened during this file. |
| 332 | current_file: *[]const u8, | 334 | current_file: *[]const u8, |
test/src/convert-stack-trace.zig+1-1| ... | @@ -44,7 +44,7 @@ pub fn main() !void { | ... | @@ -44,7 +44,7 @@ pub fn main() !void { |
| 44 | const in_file = try std.fs.cwd().openFile(args[1], .{}); | 44 | const in_file = try std.fs.cwd().openFile(args[1], .{}); |
| 45 | defer in_file.close(); | 45 | defer in_file.close(); |
| 46 | 46 | ||
| 47 | const out_file: std.fs.File = .stdout(); | 47 | const out_file: std.Io.File = .stdout(); |
| 48 | 48 | ||
| 49 | var in_fr = in_file.reader(io, &read_buf); | 49 | var in_fr = in_file.reader(io, &read_buf); |
| 50 | var out_fw = out_file.writer(&write_buf); | 50 | var out_fw = out_file.writer(&write_buf); |
test/standalone/child_process/child.zig+3-3| ... | @@ -33,12 +33,12 @@ fn run(allocator: std.mem.Allocator, io: Io) !void { | ... | @@ -33,12 +33,12 @@ fn run(allocator: std.mem.Allocator, io: Io) !void { |
| 33 | } | 33 | } |
| 34 | 34 | ||
| 35 | // test stdout pipe; parent verifies | 35 | // test stdout pipe; parent verifies |
| 36 | try std.fs.File.stdout().writeAll("hello from stdout"); | 36 | try std.Io.File.stdout().writeAll("hello from stdout"); |
| 37 | 37 | ||
| 38 | // test stdin pipe from parent | 38 | // test stdin pipe from parent |
| 39 | const hello_stdin = "hello from stdin"; | 39 | const hello_stdin = "hello from stdin"; |
| 40 | var buf: [hello_stdin.len]u8 = undefined; | 40 | var buf: [hello_stdin.len]u8 = undefined; |
| 41 | const stdin: std.fs.File = .stdin(); | 41 | const stdin: std.Io.File = .stdin(); |
| 42 | var reader = stdin.reader(io, &.{}); | 42 | var reader = stdin.reader(io, &.{}); |
| 43 | const n = try reader.interface.readSliceShort(&buf); | 43 | const n = try reader.interface.readSliceShort(&buf); |
| 44 | if (!std.mem.eql(u8, buf[0..n], hello_stdin)) { | 44 | if (!std.mem.eql(u8, buf[0..n], hello_stdin)) { |
| ... | @@ -47,7 +47,7 @@ fn run(allocator: std.mem.Allocator, io: Io) !void { | ... | @@ -47,7 +47,7 @@ fn run(allocator: std.mem.Allocator, io: Io) !void { |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | fn testError(comptime fmt: []const u8, args: anytype) void { | 49 | fn testError(comptime fmt: []const u8, args: anytype) void { |
| 50 | var stderr_writer = std.fs.File.stderr().writer(&.{}); | 50 | var stderr_writer = std.Io.File.stderr().writer(&.{}); |
| 51 | const stderr = &stderr_writer.interface; | 51 | const stderr = &stderr_writer.interface; |
| 52 | stderr.print("CHILD TEST ERROR: ", .{}) catch {}; | 52 | stderr.print("CHILD TEST ERROR: ", .{}) catch {}; |
| 53 | stderr.print(fmt, args) catch {}; | 53 | stderr.print(fmt, args) catch {}; |
test/standalone/child_process/main.zig+1-1| ... | @@ -62,7 +62,7 @@ pub fn main() !void { | ... | @@ -62,7 +62,7 @@ pub fn main() !void { |
| 62 | var parent_test_error = false; | 62 | var parent_test_error = false; |
| 63 | 63 | ||
| 64 | fn testError(comptime fmt: []const u8, args: anytype) void { | 64 | fn testError(comptime fmt: []const u8, args: anytype) void { |
| 65 | var stderr_writer = std.fs.File.stderr().writer(&.{}); | 65 | var stderr_writer = std.Io.File.stderr().writer(&.{}); |
| 66 | const stderr = &stderr_writer.interface; | 66 | const stderr = &stderr_writer.interface; |
| 67 | stderr.print("PARENT TEST ERROR: ", .{}) catch {}; | 67 | stderr.print("PARENT TEST ERROR: ", .{}) catch {}; |
| 68 | stderr.print(fmt, args) catch {}; | 68 | stderr.print(fmt, args) catch {}; |
test/standalone/simple/cat/main.zig+4-4| ... | @@ -1,5 +1,5 @@ | ... | @@ -1,5 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const fs = std.fs; | 2 | const Io = std.Io; |
| 3 | const mem = std.mem; | 3 | const mem = std.mem; |
| 4 | const warn = std.log.warn; | 4 | const warn = std.log.warn; |
| 5 | const fatal = std.process.fatal; | 5 | const fatal = std.process.fatal; |
| ... | @@ -18,11 +18,11 @@ pub fn main() !void { | ... | @@ -18,11 +18,11 @@ pub fn main() !void { |
| 18 | const exe = args[0]; | 18 | const exe = args[0]; |
| 19 | var catted_anything = false; | 19 | var catted_anything = false; |
| 20 | var stdout_buffer: [4096]u8 = undefined; | 20 | var stdout_buffer: [4096]u8 = undefined; |
| 21 | var stdout_writer = fs.File.stdout().writerStreaming(&stdout_buffer); | 21 | var stdout_writer = Io.File.stdout().writerStreaming(&stdout_buffer); |
| 22 | const stdout = &stdout_writer.interface; | 22 | const stdout = &stdout_writer.interface; |
| 23 | var stdin_reader = fs.File.stdin().readerStreaming(io, &.{}); | 23 | var stdin_reader = Io.File.stdin().readerStreaming(io, &.{}); |
| 24 | 24 | ||
| 25 | const cwd = fs.cwd(); | 25 | const cwd = Io.Dir.cwd(); |
| 26 | 26 | ||
| 27 | for (args[1..]) |arg| { | 27 | for (args[1..]) |arg| { |
| 28 | if (mem.eql(u8, arg, "-")) { | 28 | if (mem.eql(u8, arg, "-")) { |
test/standalone/simple/guess_number/main.zig+2-2| ... | @@ -2,9 +2,9 @@ const builtin = @import("builtin"); | ... | @@ -2,9 +2,9 @@ const builtin = @import("builtin"); |
| 2 | const std = @import("std"); | 2 | const std = @import("std"); |
| 3 | 3 | ||
| 4 | pub fn main() !void { | 4 | pub fn main() !void { |
| 5 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 5 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 6 | const out = &stdout_writer.interface; | 6 | const out = &stdout_writer.interface; |
| 7 | const stdin: std.fs.File = .stdin(); | 7 | const stdin: std.Io.File = .stdin(); |
| 8 | 8 | ||
| 9 | try out.writeAll("Welcome to the Guess Number Game in Zig.\n"); | 9 | try out.writeAll("Welcome to the Guess Number Game in Zig.\n"); |
| 10 | 10 |
test/standalone/simple/hello_world/hello.zig+1-1| ... | @@ -1,5 +1,5 @@ | ... | @@ -1,5 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | 2 | ||
| 3 | pub fn main() !void { | 3 | pub fn main() !void { |
| 4 | try std.fs.File.stdout().writeAll("Hello, World!\n"); | 4 | try std.Io.File.stdout().writeAll("Hello, World!\n"); |
| 5 | } | 5 | } |
test/standalone/windows_bat_args/echo-args.zig+1-1| ... | @@ -5,7 +5,7 @@ pub fn main() !void { | ... | @@ -5,7 +5,7 @@ pub fn main() !void { |
| 5 | defer arena_state.deinit(); | 5 | defer arena_state.deinit(); |
| 6 | const arena = arena_state.allocator(); | 6 | const arena = arena_state.allocator(); |
| 7 | 7 | ||
| 8 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 8 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 9 | const stdout = &stdout_writer.interface; | 9 | const stdout = &stdout_writer.interface; |
| 10 | var args = try std.process.argsAlloc(arena); | 10 | var args = try std.process.argsAlloc(arena); |
| 11 | for (args[1..], 1..) |arg, i| { | 11 | for (args[1..], 1..) |arg, i| { |
test/standalone/windows_paths/relative.zig+1-1| ... | @@ -13,7 +13,7 @@ pub fn main() !void { | ... | @@ -13,7 +13,7 @@ pub fn main() !void { |
| 13 | const relative = try std.fs.path.relative(allocator, args[1], args[2]); | 13 | const relative = try std.fs.path.relative(allocator, args[1], args[2]); |
| 14 | defer allocator.free(relative); | 14 | defer allocator.free(relative); |
| 15 | 15 | ||
| 16 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 16 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 17 | const stdout = &stdout_writer.interface; | 17 | const stdout = &stdout_writer.interface; |
| 18 | try stdout.writeAll(relative); | 18 | try stdout.writeAll(relative); |
| 19 | } | 19 | } |
test/standalone/windows_spawn/hello.zig+1-1| ... | @@ -1,7 +1,7 @@ | ... | @@ -1,7 +1,7 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | 2 | ||
| 3 | pub fn main() !void { | 3 | pub fn main() !void { |
| 4 | var stdout_writer = std.fs.File.stdout().writerStreaming(&.{}); | 4 | var stdout_writer = std.Io.File.stdout().writerStreaming(&.{}); |
| 5 | const stdout = &stdout_writer.interface; | 5 | const stdout = &stdout_writer.interface; |
| 6 | try stdout.writeAll("hello from exe\n"); | 6 | try stdout.writeAll("hello from exe\n"); |
| 7 | } | 7 | } |
test/standalone/windows_spawn/main.zig+2-1| ... | @@ -1,4 +1,5 @@ | ... | @@ -1,4 +1,5 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const Io = std.Io; | ||
| 2 | 3 | ||
| 3 | const windows = std.os.windows; | 4 | const windows = std.os.windows; |
| 4 | const utf16Literal = std.unicode.utf8ToUtf16LeStringLiteral; | 5 | const utf16Literal = std.unicode.utf8ToUtf16LeStringLiteral; |
| ... | @@ -218,7 +219,7 @@ fn testExecWithCwd(allocator: std.mem.Allocator, command: []const u8, cwd: ?[]co | ... | @@ -218,7 +219,7 @@ fn testExecWithCwd(allocator: std.mem.Allocator, command: []const u8, cwd: ?[]co |
| 218 | try std.testing.expectEqualStrings(expected_stdout, result.stdout); | 219 | try std.testing.expectEqualStrings(expected_stdout, result.stdout); |
| 219 | } | 220 | } |
| 220 | 221 | ||
| 221 | fn renameExe(dir: std.fs.Dir, old_sub_path: []const u8, new_sub_path: []const u8) !void { | 222 | fn renameExe(dir: Io.Dir, old_sub_path: []const u8, new_sub_path: []const u8) !void { |
| 222 | var attempt: u5 = 0; | 223 | var attempt: u5 = 0; |
| 223 | while (true) break dir.rename(old_sub_path, new_sub_path) catch |err| switch (err) { | 224 | while (true) break dir.rename(old_sub_path, new_sub_path) catch |err| switch (err) { |
| 224 | error.AccessDenied => { | 225 | error.AccessDenied => { |
test/tests.zig+2-1| ... | @@ -2629,10 +2629,11 @@ pub fn addCases( | ... | @@ -2629,10 +2629,11 @@ pub fn addCases( |
| 2629 | ) !void { | 2629 | ) !void { |
| 2630 | const arena = b.allocator; | 2630 | const arena = b.allocator; |
| 2631 | const gpa = b.allocator; | 2631 | const gpa = b.allocator; |
| 2632 | const io = b.graph.io; | ||
| 2632 | 2633 | ||
| 2633 | var cases = @import("src/Cases.zig").init(gpa, arena); | 2634 | var cases = @import("src/Cases.zig").init(gpa, arena); |
| 2634 | 2635 | ||
| 2635 | var dir = try b.build_root.handle.openDir("test/cases", .{ .iterate = true }); | 2636 | var dir = try b.build_root.handle.openDir(io, "test/cases", .{ .iterate = true }); |
| 2636 | defer dir.close(); | 2637 | defer dir.close(); |
| 2637 | 2638 | ||
| 2638 | cases.addFromDir(dir, b); | 2639 | cases.addFromDir(dir, b); |