| 1 | #update=non-inline version |
| 2 | #file=main.zig |
| 3 | pub fn main() !void { |
| 4 | try foo(); |
| 5 | } |
| 6 | fn foo() !void { |
| 7 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); |
| 8 | } |
| 9 | const std = @import("std"); |
| 10 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 11 | #expect_stdout="Hello, World!\n" |
| 12 | |
| 13 | #update=make function inline |
| 14 | #file=main.zig |
| 15 | pub fn main() !void { |
| 16 | try foo(); |
| 17 | } |
| 18 | inline fn foo() !void { |
| 19 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, World!\n"); |
| 20 | } |
| 21 | const std = @import("std"); |
| 22 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 23 | #expect_stdout="Hello, World!\n" |
| 24 | |
| 25 | #update=change string |
| 26 | #file=main.zig |
| 27 | pub fn main() !void { |
| 28 | try foo(); |
| 29 | } |
| 30 | inline fn foo() !void { |
| 31 | try std.Io.File.stdout().writeStreamingAll(io, "Hello, `inline` World!\n"); |
| 32 | } |
| 33 | const std = @import("std"); |
| 34 | const io = std.Io.Threaded.global_single_threaded.io(); |
| 35 | #expect_stdout="Hello, `inline` World!\n" |