mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
child process test: preemptively use streaming mode
works around #24984
This commit is contained in:
parent
07da9567e6
commit
31a0c2a36a
1 changed files with 1 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ pub fn main() !void {
|
||||||
|
|
||||||
const hello_stdout = "hello from stdout";
|
const hello_stdout = "hello from stdout";
|
||||||
var buf: [hello_stdout.len]u8 = undefined;
|
var buf: [hello_stdout.len]u8 = undefined;
|
||||||
var stdout_reader = child.stdout.?.reader(&.{});
|
var stdout_reader = child.stdout.?.readerStreaming(&.{});
|
||||||
const n = try stdout_reader.interface.readSliceShort(&buf);
|
const n = try stdout_reader.interface.readSliceShort(&buf);
|
||||||
if (!std.mem.eql(u8, buf[0..n], hello_stdout)) {
|
if (!std.mem.eql(u8, buf[0..n], hello_stdout)) {
|
||||||
testError("child stdout: '{s}'; want '{s}'", .{ buf[0..n], hello_stdout });
|
testError("child stdout: '{s}'; want '{s}'", .{ buf[0..n], hello_stdout });
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue