Skip to content
Myr

Add more tests related to using `\0` with `$` (#850)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by GitHub · parent 381dee2 · Browse files · 1 file+11 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+11 added−0 removed

  • tests:+11 added−0 removed

1 file+11 added−0 removed

modified:test/script.js+11 added
238 unmodified lines
239test('$ splits expressions - \\u{0063}}', testScriptStdout, () => $`echo.js ${'a'}\u{0063}}${'b'}`, 'ac}b');240test('$ concatenates tokens - \\u{0063}}', testScriptStdout, () => $`echo.js \u{0063}}a\u{0063}} b`, 'c}ac}\nb');241test('$ concatenates expressions - \\u{0063}}', testScriptStdout, () => $`echo.js \u{0063}}${'a'}\u{0063}} b`, 'c}ac}\nb');242243const testScriptErrorStdout = async (t, getChildProcess, expectedStdout) => {244 const {command} = await t.throwsAsync(getChildProcess(), {code: 'ERR_INVALID_ARG_VALUE'});245 t.is(command, `echo.js ${expectedStdout}`);246};247248test('$ handles tokens - \\0', testScriptErrorStdout, () => $`echo.js \0`, '\0');249test('$ splits tokens - \\0', testScriptErrorStdout, () => $`echo.js a\0b`, 'a\0b');250test('$ splits expressions - \\0', testScriptErrorStdout, () => $`echo.js ${'a'}\0${'b'}`, 'a\0b');251test('$ concatenates tokens - \\0', testScriptErrorStdout, () => $`echo.js \0a\0 b`, '\0a\0 b');252test('$ concatenates expressions - \\0', testScriptErrorStdout, () => $`echo.js \0${'a'}\0 b`, '\0a\0 b');253254const testScriptStdoutSync = (t, getChildProcess, expectedStdout) => {255 const {stdout} = getChildProcess();256 t.is(stdout, expectedStdout);257};
212 unmodified lines