diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-08-12 19:20:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-12 14:20:34 -0400 |
commit | 18ec1290afcd78c61933ecb52e3ad97cf644f0d5 (patch) | |
tree | 10705623951571e5ef73febdcee76e4def280ce7 /cli/tests/unit | |
parent | 452693256ce7b607fa0b9454b22c57748f616742 (diff) |
feat: Support file URLs in Deno.run for executable (#6994)
Diffstat (limited to 'cli/tests/unit')
-rw-r--r-- | cli/tests/unit/process_test.ts | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cli/tests/unit/process_test.ts b/cli/tests/unit/process_test.ts index 966a9425b..5b7844970 100644 --- a/cli/tests/unit/process_test.ts +++ b/cli/tests/unit/process_test.ts @@ -26,6 +26,29 @@ unitTest({ perms: { run: true } }, async function runSuccess(): Promise<void> { p.stdout.close(); p.close(); }); + +unitTest({ perms: { run: true } }, async function runUrl(): Promise<void> { + const q = Deno.run({ + cmd: ["python", "-c", "import sys; print sys.executable"], + stdout: "piped", + }); + await q.status(); + const pythonPath = new TextDecoder().decode(await q.output()).trim(); + q.close(); + + const p = Deno.run({ + cmd: [new URL(`file:///${pythonPath}`), "-c", "print('hello world')"], + stdout: "piped", + stderr: "null", + }); + const status = await p.status(); + assertEquals(status.success, true); + assertEquals(status.code, 0); + assertEquals(status.signal, undefined); + p.stdout.close(); + p.close(); +}); + unitTest({ perms: { run: true } }, async function runStdinRid0(): Promise< void > { |