Skip to content

Commit

Permalink
Add regression test for values with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
coreybutler committed Aug 4, 2021
1 parent 8747122 commit 21fd02b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/09-regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,17 @@ test('Non-Boolean Regression Test', t => {
t.ok(d.more === true, 'Recognized boolean flag.')
t.ok(d.t === true, 'Treat unrecognized flags separtely from boolean flag. Expected a flag called "t" to exist. Recognized: ' + d.hasOwnProperty('t'))
t.end()
})

test('Flag values with spaces', t => {
const input = 'test -c "my connection"'
const cfg = {
connection: {
alias: 'c'
}
}
const { data } = new Parser(input, cfg)

t.expect('my connection', data.connection, 'Extract escaped values with spaces')
t.end()
})

0 comments on commit 21fd02b

Please sign in to comment.