summaryrefslogtreecommitdiff
path: root/tests/unit/process_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/process_test.ts')
-rw-r--r--tests/unit/process_test.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/unit/process_test.ts b/tests/unit/process_test.ts
index 0cc4e99aa..040c6ee19 100644
--- a/tests/unit/process_test.ts
+++ b/tests/unit/process_test.ts
@@ -220,7 +220,13 @@ Deno.test(
cmd: [
Deno.execPath(),
"eval",
- "if (new TextDecoder().decode(await Deno.readAll(Deno.stdin)) !== 'hello') throw new Error('Expected \\'hello\\'')",
+ `
+ const buffer = new Uint8Array(5);
+ await Deno.stdin.read(buffer);
+ if (new TextDecoder().decode(buffer) !== "hello") {
+ throw new Error('Expected \\'hello\\'')
+ }
+ `,
],
stdin: "piped",
});
@@ -402,7 +408,13 @@ Deno.test(
cmd: [
Deno.execPath(),
"eval",
- "if (new TextDecoder().decode(await Deno.readAll(Deno.stdin)) !== 'hello') throw new Error('Expected \\'hello\\'')",
+ `
+ const buffer = new Uint8Array(5);
+ await Deno.stdin.read(buffer);
+ if (new TextDecoder().decode(buffer) !== "hello") {
+ throw new Error('Expected \\'hello\\'')
+ }
+ `,
],
stdin: file.rid,
});