diff options
Diffstat (limited to 'cli/js/tests/process_test.ts')
-rw-r--r-- | cli/js/tests/process_test.ts | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/cli/js/tests/process_test.ts b/cli/js/tests/process_test.ts index 216b8a3bd..47efd86d5 100644 --- a/cli/js/tests/process_test.ts +++ b/cli/js/tests/process_test.ts @@ -3,7 +3,7 @@ import { assert, assertEquals, assertStrContains, - unitTest + unitTest, } from "./test_util.ts"; const { kill, run, readFile, open, makeTempDir, writeFile } = Deno; @@ -22,7 +22,7 @@ unitTest({ perms: { run: true } }, async function runSuccess(): Promise<void> { const p = run({ cmd: ["python", "-c", "print('hello world')"], stdout: "piped", - stderr: "null" + stderr: "null", }); const status = await p.status(); assertEquals(status.success, true); @@ -36,7 +36,7 @@ unitTest( { perms: { run: true } }, async function runCommandFailedWithCode(): Promise<void> { const p = run({ - cmd: ["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); @@ -50,11 +50,11 @@ unitTest( { // No signals on windows. ignore: Deno.build.os === "win", - perms: { run: true } + perms: { run: true }, }, async function runCommandFailedWithSignal(): Promise<void> { const p = run({ - cmd: ["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); @@ -102,7 +102,7 @@ while True: Deno.writeFileSync(`${cwd}/${pyProgramFile}.py`, enc.encode(pyProgram)); const p = run({ cwd, - cmd: ["python", `${pyProgramFile}.py`] + cmd: ["python", `${pyProgramFile}.py`], }); // Write the expected exit code *after* starting python. @@ -123,7 +123,7 @@ unitTest({ perms: { run: true } }, async function runStdinPiped(): Promise< > { const p = run({ cmd: ["python", "-c", "import sys; assert 'hello' == sys.stdin.read();"], - stdin: "piped" + stdin: "piped", }); assert(p.stdin); assert(!p.stdout); @@ -147,7 +147,7 @@ unitTest({ perms: { run: true } }, async function runStdoutPiped(): Promise< > { const p = run({ cmd: ["python", "-c", "import sys; sys.stdout.write('hello')"], - stdout: "piped" + stdout: "piped", }); assert(!p.stdin); assert(!p.stderr); @@ -176,7 +176,7 @@ unitTest({ perms: { run: true } }, async function runStderrPiped(): Promise< > { const p = run({ cmd: ["python", "-c", "import sys; sys.stderr.write('hello')"], - stderr: "piped" + stderr: "piped", }); assert(!p.stdin); assert(!p.stdout); @@ -203,7 +203,7 @@ unitTest({ perms: { run: true } }, async function runStderrPiped(): Promise< unitTest({ perms: { run: true } }, async function runOutput(): Promise<void> { const p = run({ cmd: ["python", "-c", "import sys; sys.stdout.write('hello')"], - stdout: "piped" + stdout: "piped", }); const output = await p.output(); const s = new TextDecoder().decode(output); @@ -216,7 +216,7 @@ unitTest({ perms: { run: true } }, async function runStderrOutput(): Promise< > { const p = run({ cmd: ["python", "-c", "import sys; sys.stderr.write('error')"], - stderr: "piped" + stderr: "piped", }); const error = await p.stderrOutput(); const s = new TextDecoder().decode(error); @@ -235,10 +235,10 @@ unitTest( cmd: [ "python", "-c", - "import sys; sys.stderr.write('error\\n'); sys.stdout.write('output\\n');" + "import sys; sys.stderr.write('error\\n'); sys.stdout.write('output\\n');", ], stdout: file.rid, - stderr: file.rid + stderr: file.rid, }); await p.status(); @@ -265,7 +265,7 @@ unitTest( const p = run({ cmd: ["python", "-c", "import sys; assert 'hello' == sys.stdin.read();"], - stdin: file.rid + stdin: file.rid, }); const status = await p.status(); @@ -280,13 +280,13 @@ unitTest({ perms: { run: true } }, async function runEnv(): Promise<void> { cmd: [ "python", "-c", - "import os, sys; sys.stdout.write(os.environ.get('FOO', '') + os.environ.get('BAR', ''))" + "import os, sys; sys.stdout.write(os.environ.get('FOO', '') + os.environ.get('BAR', ''))", ], env: { FOO: "0123", - BAR: "4567" + BAR: "4567", }, - stdout: "piped" + stdout: "piped", }); const output = await p.output(); const s = new TextDecoder().decode(output); @@ -299,9 +299,9 @@ unitTest({ perms: { run: true } }, async function runClose(): Promise<void> { cmd: [ "python", "-c", - "from time import sleep; import sys; sleep(10000); sys.stderr.write('error')" + "from time import sleep; import sys; sleep(10000); sys.stderr.write('error')", ], - stderr: "piped" + stderr: "piped", }); assert(!p.stdin); assert(!p.stdout); @@ -343,7 +343,7 @@ if (Deno.build.os !== "win") { void > { const p = run({ - cmd: ["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({ - cmd: ["python", "-c", "from time import sleep; sleep(10000)"] + cmd: ["python", "-c", "from time import sleep; sleep(10000)"], }); assert(!p.stdin); assert(!p.stdout); |