diff options
Diffstat (limited to 'cli/js/tests')
-rw-r--r-- | cli/js/tests/chown_test.ts | 4 | ||||
-rw-r--r-- | cli/js/tests/os_test.ts | 2 | ||||
-rw-r--r-- | cli/js/tests/process_test.ts | 34 | ||||
-rwxr-xr-x | cli/js/tests/unit_test_runner.ts | 8 |
4 files changed, 24 insertions, 24 deletions
diff --git a/cli/js/tests/chown_test.ts b/cli/js/tests/chown_test.ts index 50dcd6dc1..f1847a08c 100644 --- a/cli/js/tests/chown_test.ts +++ b/cli/js/tests/chown_test.ts @@ -7,11 +7,11 @@ if (Deno.build.os !== "win") { // get the user ID and group ID of the current process const uidProc = Deno.run({ stdout: "piped", - args: ["python", "-c", "import os; print(os.getuid())"] + cmd: ["python", "-c", "import os; print(os.getuid())"] }); const gidProc = Deno.run({ stdout: "piped", - args: ["python", "-c", "import os; print(os.getgid())"] + cmd: ["python", "-c", "import os; print(os.getgid())"] }); assertEquals((await uidProc.status()).code, 0); diff --git a/cli/js/tests/os_test.ts b/cli/js/tests/os_test.ts index bc1766a2b..ef45d36fe 100644 --- a/cli/js/tests/os_test.ts +++ b/cli/js/tests/os_test.ts @@ -65,7 +65,7 @@ unitTest( ${JSON.stringify(Object.keys(expectedEnv))}.map(k => Deno.env(k)) )`; const proc = Deno.run({ - args: [Deno.execPath(), "eval", src], + cmd: [Deno.execPath(), "eval", src], env: inputEnv, stdout: "piped" }); diff --git a/cli/js/tests/process_test.ts b/cli/js/tests/process_test.ts index e2da6cab5..216b8a3bd 100644 --- a/cli/js/tests/process_test.ts +++ b/cli/js/tests/process_test.ts @@ -10,7 +10,7 @@ const { kill, run, readFile, open, makeTempDir, writeFile } = Deno; unitTest(function runPermissions(): void { let caughtError = false; try { - Deno.run({ args: ["python", "-c", "print('hello world')"] }); + Deno.run({ cmd: ["python", "-c", "print('hello world')"] }); } catch (e) { caughtError = true; assert(e instanceof Deno.errors.PermissionDenied); @@ -20,7 +20,7 @@ unitTest(function runPermissions(): void { unitTest({ perms: { run: true } }, async function runSuccess(): Promise<void> { const p = run({ - args: ["python", "-c", "print('hello world')"], + cmd: ["python", "-c", "print('hello world')"], stdout: "piped", stderr: "null" }); @@ -36,7 +36,7 @@ unitTest( { perms: { run: true } }, async function runCommandFailedWithCode(): Promise<void> { const p = run({ - args: ["python", "-c", "import sys;sys.exit(41 + 1)"] + cmd: ["python", "-c", "import sys;sys.exit(41 + 1)"] }); const status = await p.status(); assertEquals(status.success, false); @@ -54,7 +54,7 @@ unitTest( }, async function runCommandFailedWithSignal(): Promise<void> { const p = run({ - args: ["python", "-c", "import os;os.kill(os.getpid(), 9)"] + cmd: ["python", "-c", "import os;os.kill(os.getpid(), 9)"] }); const status = await p.status(); assertEquals(status.success, false); @@ -67,7 +67,7 @@ unitTest( unitTest({ perms: { run: true } }, function runNotFound(): void { let error; try { - run({ args: ["this file hopefully doesn't exist"] }); + run({ cmd: ["this file hopefully doesn't exist"] }); } catch (e) { error = e; } @@ -102,7 +102,7 @@ while True: Deno.writeFileSync(`${cwd}/${pyProgramFile}.py`, enc.encode(pyProgram)); const p = run({ cwd, - args: ["python", `${pyProgramFile}.py`] + cmd: ["python", `${pyProgramFile}.py`] }); // Write the expected exit code *after* starting python. @@ -122,7 +122,7 @@ unitTest({ perms: { run: true } }, async function runStdinPiped(): Promise< void > { const p = run({ - args: ["python", "-c", "import sys; assert 'hello' == sys.stdin.read();"], + cmd: ["python", "-c", "import sys; assert 'hello' == sys.stdin.read();"], stdin: "piped" }); assert(p.stdin); @@ -146,7 +146,7 @@ unitTest({ perms: { run: true } }, async function runStdoutPiped(): Promise< void > { const p = run({ - args: ["python", "-c", "import sys; sys.stdout.write('hello')"], + cmd: ["python", "-c", "import sys; sys.stdout.write('hello')"], stdout: "piped" }); assert(!p.stdin); @@ -175,7 +175,7 @@ unitTest({ perms: { run: true } }, async function runStderrPiped(): Promise< void > { const p = run({ - args: ["python", "-c", "import sys; sys.stderr.write('hello')"], + cmd: ["python", "-c", "import sys; sys.stderr.write('hello')"], stderr: "piped" }); assert(!p.stdin); @@ -202,7 +202,7 @@ unitTest({ perms: { run: true } }, async function runStderrPiped(): Promise< unitTest({ perms: { run: true } }, async function runOutput(): Promise<void> { const p = run({ - args: ["python", "-c", "import sys; sys.stdout.write('hello')"], + cmd: ["python", "-c", "import sys; sys.stdout.write('hello')"], stdout: "piped" }); const output = await p.output(); @@ -215,7 +215,7 @@ unitTest({ perms: { run: true } }, async function runStderrOutput(): Promise< void > { const p = run({ - args: ["python", "-c", "import sys; sys.stderr.write('error')"], + cmd: ["python", "-c", "import sys; sys.stderr.write('error')"], stderr: "piped" }); const error = await p.stderrOutput(); @@ -232,7 +232,7 @@ unitTest( const file = await open(fileName, "w"); const p = run({ - args: [ + cmd: [ "python", "-c", "import sys; sys.stderr.write('error\\n'); sys.stdout.write('output\\n');" @@ -264,7 +264,7 @@ unitTest( const file = await open(fileName, "r"); const p = run({ - args: ["python", "-c", "import sys; assert 'hello' == sys.stdin.read();"], + cmd: ["python", "-c", "import sys; assert 'hello' == sys.stdin.read();"], stdin: file.rid }); @@ -277,7 +277,7 @@ unitTest( unitTest({ perms: { run: true } }, async function runEnv(): Promise<void> { const p = run({ - args: [ + cmd: [ "python", "-c", "import os, sys; sys.stdout.write(os.environ.get('FOO', '') + os.environ.get('BAR', ''))" @@ -296,7 +296,7 @@ unitTest({ perms: { run: true } }, async function runEnv(): Promise<void> { unitTest({ perms: { run: true } }, async function runClose(): Promise<void> { const p = run({ - args: [ + cmd: [ "python", "-c", "from time import sleep; import sys; sleep(10000); sys.stderr.write('error')" @@ -343,7 +343,7 @@ if (Deno.build.os !== "win") { void > { const p = run({ - args: ["python", "-c", "from time import sleep; sleep(10000)"] + cmd: ["python", "-c", "from time import sleep; sleep(10000)"] }); assertEquals(Deno.Signal.SIGINT, 2); @@ -361,7 +361,7 @@ if (Deno.build.os !== "win") { unitTest({ perms: { run: true } }, function killFailed(): void { const p = run({ - args: ["python", "-c", "from time import sleep; sleep(10000)"] + cmd: ["python", "-c", "from time import sleep; sleep(10000)"] }); assert(!p.stdin); assert(!p.stdout); diff --git a/cli/js/tests/unit_test_runner.ts b/cli/js/tests/unit_test_runner.ts index 62c3250a7..e79e1b7ea 100755 --- a/cli/js/tests/unit_test_runner.ts +++ b/cli/js/tests/unit_test_runner.ts @@ -86,7 +86,7 @@ function spawnWorkerRunner( }) .join(","); - const args = [ + const cmd = [ Deno.execPath(), "run", "-A", @@ -97,14 +97,14 @@ function spawnWorkerRunner( ]; if (filter) { - args.push("--"); - args.push(filter); + cmd.push("--"); + cmd.push(filter); } const ioMode = verbose ? "inherit" : "null"; const p = Deno.run({ - args, + cmd, stdin: ioMode, stdout: ioMode, stderr: ioMode |