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