diff options
author | Asher Gomez <ashersaupingomez@gmail.com> | 2024-03-21 04:39:17 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 10:39:17 -0700 |
commit | d66154d42a8e0f044ef8cab7947c5a4909782184 (patch) | |
tree | 40b19e5f1b3a6b339b04fb7dd959740c39feefd5 /tests/unit/command_test.ts | |
parent | fb0744f4e1ad08597d194fdf99f5a786cd62569c (diff) |
chore(ext/buffer): remove use of deprecated `Deno.readAll()` (#22874)
Diffstat (limited to 'tests/unit/command_test.ts')
-rw-r--r-- | tests/unit/command_test.ts | 16 |
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", |