Skip to content
Myr

Fixes argument parsing for escaped newlines (#1176)

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

authored by Aaron Dandy · committed by GitHub · parent c8cff27 · Browse files · 2 files+13 added−1 removed
This commit

State

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

Trailers

  • Co-authored-by: user <user@localhost.com>

Diff stats

2 files+13 added−1 removed

  • tests:+8 added−0 removed
  • other:+5 added−1 removed

2 files+13 added−1 removed

modified:lib/methods/template.js+5 added-1 removed
modified:test/methods/template.js+8 added
20 unmodified lines
21test('$ can use newlines and tab indentations', testScriptStdout, () => $`echo.js foo22 bar`, 'foo\nbar');23test('$ can use newlines and space indentations', testScriptStdout, () => $`echo.js foo24 bar`, 'foo\nbar');25test('$ can use escaped newlines and space indentations', testScriptStdout, () => $`echo.js foo\26 bar`, 'foo\nbar');27test('$ can use escaped newlines and inline tab indentations', testScriptStdout, () => $`echo.js foo\28 bar`, 'foo\nbar');29test('$ can use escaped newlines and character escaped tab indentations', testScriptStdout, () => $`echo.js foo\30\tbar`, 'foo\tbar');31test('$ can use escaped newlines and character escaped newlines', testScriptStdout, () => $`echo.js foo\32\n\nbar`, 'foo\n\nbar');33test('$ can use Windows newlines and tab indentations', testScriptStdout, () => escapedCall('echo.js foo\r\n\tbar'), 'foo\nbar');34test('$ can use Windows newlines and space indentations', testScriptStdout, () => escapedCall('echo.js foo\r\n bar'), 'foo\nbar');35test('$ does not ignore comments in expressions', testScriptStdout, () => $`echo.js foo36 ${/* This is a comment */''}
316 unmodified lines