Skip to content

Commit

Permalink
Windows tests for TypeScript bindings.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhop committed Sep 5, 2024
1 parent 117e212 commit 10f2deb
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
16 changes: 0 additions & 16 deletions ts-tests/pwsh.ts

This file was deleted.

9 changes: 9 additions & 0 deletions ts-tests/win-cmd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

import {$sh, currentExecPath, winCmdEscape, raw} from 'dollar-shell';

const $cmd = $sh({stdout: 'inherit', stderr: 'inherit'});

console.log(await $cmd`echo ${winCmdEscape('12""3')} ${raw('abc')}`);
console.log(await $cmd`echo ${winCmdEscape(`hello \\wor"ld`)}`);
console.log(await $cmd`${currentExecPath()} ${'tests\\manual\\argv.js'} ${`hello \\wor"ld`}`);
14 changes: 14 additions & 0 deletions ts-tests/win-pwsh.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
'use strict';

import {$sh, currentExecPath} from 'dollar-shell';

const $cmd = $sh({stdout: 'inherit', stderr: 'inherit'});
const $pwsh = $cmd({shellPath: 'pwsh.exe'});

console.log(await $pwsh`echo ${'12""3'}`);
console.log(await $pwsh`echo ${`hello \\wor"ld`}`);
console.log(await $pwsh`${currentExecPath()} ${'tests\\manual\\argv.js'} ${`hello \\wor"ld`}`);

// tests how pwsh handles escaped arguments
console.log(await $pwsh`echo 1 2 3`);
console.log(await $pwsh`echo ${'1 2 3'}`);

0 comments on commit 10f2deb

Please sign in to comment.