mirror of
https://github.com/denoland/deno.git
synced 2025-01-11 08:33:43 -05:00
chore(ext/buffer): remove use of deprecated Deno.readAll()
(#22874)
This commit is contained in:
parent
fb0744f4e1
commit
d66154d42a
2 changed files with 28 additions and 4 deletions
|
@ -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",
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue