securityos/node_modules/shell-parse/tests/escaping-in-quotes.js

19 lines
466 B
JavaScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
var test = require('tape')
var parse = require('../parser')
test('escaping in quotes', function (t) {
var arg = parse('"An escaped double-quote: \\""', 'argument')
t.deepEqual(arg, {
type:"literal",
value:"An escaped double-quote: \""
}, "Can escape double-quotes")
var arg = parse('"An escaped \\$dollar sign"', 'argument')
t.deepEqual(arg, {
type:"literal",
value:"An escaped $dollar sign"
}, "Can escape dollar signs")
t.end()
})