diff options
| author | ruki <[email protected]> | 2025-12-19 00:55:43 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-12-19 00:55:43 +0800 |
| commit | 613b0c06a23b83f14184eedfed8c151896a04521 (patch) | |
| tree | 52feb7f08d433b707ef3b08fcbef7e520cc8f78e /tests/projects | |
| parent | b5c171f495e4a2019b145622d6df0688ba337480 (diff) | |
update zig examples
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/package/toolchain_zig/src/main.zig | 3 | ||||
| -rw-r--r-- | tests/projects/zig/console/src/main.zig | 3 | ||||
| -rw-r--r-- | tests/projects/zig/console/src/test.zig | 6 | ||||
| -rw-r--r-- | tests/projects/zig/shared_library/src/main.zig | 3 | ||||
| -rw-r--r-- | tests/projects/zig/static_library/src/main.zig | 3 |
5 files changed, 4 insertions, 14 deletions
diff --git a/tests/projects/package/toolchain_zig/src/main.zig b/tests/projects/package/toolchain_zig/src/main.zig index 259e332e6..db34441e1 100644 --- a/tests/projects/package/toolchain_zig/src/main.zig +++ b/tests/projects/package/toolchain_zig/src/main.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub fn main() !void { - const stdout = std.io.getStdOut().writer(); - try stdout.print("Hello, {s}!\n", .{"world"}); + std.debug.print("Hello, {s}!\n", .{"world"}); } diff --git a/tests/projects/zig/console/src/main.zig b/tests/projects/zig/console/src/main.zig index 259e332e6..db34441e1 100644 --- a/tests/projects/zig/console/src/main.zig +++ b/tests/projects/zig/console/src/main.zig @@ -1,6 +1,5 @@ const std = @import("std"); pub fn main() !void { - const stdout = std.io.getStdOut().writer(); - try stdout.print("Hello, {s}!\n", .{"world"}); + std.debug.print("Hello, {s}!\n", .{"world"}); } diff --git a/tests/projects/zig/console/src/test.zig b/tests/projects/zig/console/src/test.zig deleted file mode 100644 index 84804603e..000000000 --- a/tests/projects/zig/console/src/test.zig +++ /dev/null @@ -1,6 +0,0 @@ -const std = @import("std"); - -pub fn hello() !void { - const stdout = std.io.getStdOut().outStream(); - try stdout.print("Hello, {}!\n", .{"world"}); -} diff --git a/tests/projects/zig/shared_library/src/main.zig b/tests/projects/zig/shared_library/src/main.zig index 41b6e7b50..7dc7b2bc4 100644 --- a/tests/projects/zig/shared_library/src/main.zig +++ b/tests/projects/zig/shared_library/src/main.zig @@ -3,6 +3,5 @@ const std = @import("std"); extern fn add(a: i32, b: i32) i32; pub fn main() !void { - const stdout = std.io.getStdOut().writer(); - try stdout.print("Hello, {s} - {*}!\n", .{"world", add(1, 1)}); + std.debug.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)}); } diff --git a/tests/projects/zig/static_library/src/main.zig b/tests/projects/zig/static_library/src/main.zig index 41b6e7b50..7dc7b2bc4 100644 --- a/tests/projects/zig/static_library/src/main.zig +++ b/tests/projects/zig/static_library/src/main.zig @@ -3,6 +3,5 @@ const std = @import("std"); extern fn add(a: i32, b: i32) i32; pub fn main() !void { - const stdout = std.io.getStdOut().writer(); - try stdout.print("Hello, {s} - {*}!\n", .{"world", add(1, 1)}); + std.debug.print("Hello, {s} - {d}!\n", .{"world", add(1, 1)}); } |
