summaryrefslogtreecommitdiff
path: root/tests/unit/command_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/command_test.ts')
-rw-r--r--tests/unit/command_test.ts16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/unit/command_test.ts b/tests/unit/command_test.ts
index cbb1c4921..770a568c4 100644
--- a/tests/unit/command_test.ts
+++ b/tests/unit/command_test.ts
@@ -59,7 +59,13 @@ Deno.test(
const command = new Deno.Command(Deno.execPath(), {
args: [
"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",
stdout: "null",
@@ -214,7 +220,13 @@ Deno.test(
const command = new Deno.Command(Deno.execPath(), {
args: [
"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",
stdout: "null",