-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c7c242
commit 2b1a045
Showing
4 changed files
with
27 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,18 @@ test('Multi-value flags', t => { | |
t.expect(2, data.file.length, 'Extract multiple values') | ||
t.end() | ||
}) | ||
|
||
test('Multi-value quoted and unquoted arguments', t => { | ||
const input = '[email protected] "John Doe" empty -name \'Jill Doe\'' | ||
const cfg = { | ||
name: { alias: 'n' } | ||
} | ||
const { data } = new Parser(input, cfg) | ||
|
||
t.expect('Jill Doe', data.name, 'recognized single quoted flag') | ||
t.ok(data['[email protected]'], 'recognized unquoted string with special characters') | ||
t.ok(data['John Doe'], 'recognized double quoted argument with space in the value') | ||
t.ok(data.empty, 'recognized unquoted argument') | ||
|
||
t.end() | ||
}) |