diff options
Diffstat (limited to 'cli/tests')
-rw-r--r-- | cli/tests/cat.ts | 3 | ||||
-rw-r--r-- | cli/tests/echo_server.ts | 3 | ||||
-rw-r--r-- | cli/tests/unit/files_test.ts | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/cli/tests/cat.ts b/cli/tests/cat.ts index a5b38fccd..0cfd99d22 100644 --- a/cli/tests/cat.ts +++ b/cli/tests/cat.ts @@ -1,8 +1,9 @@ +import { copy } from "../../test_util/std/io/util.ts"; async function main(): Promise<void> { for (let i = 1; i < Deno.args.length; i++) { const filename = Deno.args[i]; const file = await Deno.open(filename); - await Deno.copy(file, Deno.stdout); + await copy(file, Deno.stdout); } } diff --git a/cli/tests/echo_server.ts b/cli/tests/echo_server.ts index fcb157fdb..7c8b0e42d 100644 --- a/cli/tests/echo_server.ts +++ b/cli/tests/echo_server.ts @@ -1,10 +1,11 @@ +import { copy } from "../../test_util/std/io/util.ts"; const addr = Deno.args[0] || "0.0.0.0:4544"; const [hostname, port] = addr.split(":"); const listener = Deno.listen({ hostname, port: Number(port) }); console.log("listening on", addr); listener.accept().then( async (conn): Promise<void> => { - console.log("received bytes:", await Deno.copy(conn, conn)); + console.log("received bytes:", await copy(conn, conn)); conn.close(); listener.close(); }, diff --git a/cli/tests/unit/files_test.ts b/cli/tests/unit/files_test.ts index 51ca1c579..348d012b4 100644 --- a/cli/tests/unit/files_test.ts +++ b/cli/tests/unit/files_test.ts @@ -8,6 +8,7 @@ import { assertThrowsAsync, unitTest, } from "./test_util.ts"; +import { copy } from "../../../test_util/std/io/util.ts"; unitTest(function filesStdioFileDescriptors(): void { assertEquals(Deno.stdin.rid, 0); @@ -21,7 +22,7 @@ unitTest({ perms: { read: true } }, async function filesCopyToStdout(): Promise< const filename = "cli/tests/fixture.json"; const file = await Deno.open(filename); assert(file.rid > 2); - const bytesWritten = await Deno.copy(file, Deno.stdout); + const bytesWritten = await copy(file, Deno.stdout); const fileSize = Deno.statSync(filename).size; assertEquals(bytesWritten, fileSize); file.close(); |