mirror of
https://github.com/deployphp/action.git
synced 2025-04-20 11:06:47 +00:00
Add missing npm package
This commit is contained in:
parent
cc5f2d19c6
commit
3ec9786507
10 changed files with 3367 additions and 0 deletions
108
node_modules/argv-split/test/argv-split.js
generated
vendored
Normal file
108
node_modules/argv-split/test/argv-split.js
generated
vendored
Normal file
|
@ -0,0 +1,108 @@
|
|||
'use strict'
|
||||
|
||||
const test = require('ava')
|
||||
const split = require('..')
|
||||
|
||||
;[
|
||||
{
|
||||
d: 'normal',
|
||||
a: 'a b c',
|
||||
e: ['a', 'b', 'c']
|
||||
},
|
||||
{
|
||||
d: 'double-quoted',
|
||||
a: '"a b c"',
|
||||
e: ['a b c']
|
||||
},
|
||||
{
|
||||
d: 'double-quoted, and trailing normal',
|
||||
a: '"a b" c',
|
||||
e: ['a b', 'c']
|
||||
},
|
||||
{
|
||||
d: 'double-quoted, and heading normal',
|
||||
a: 'c "a b"',
|
||||
e: ['c', 'a b']
|
||||
},
|
||||
{
|
||||
d: 'single-quoted',
|
||||
a: "'a b c'",
|
||||
e: ['a b c']
|
||||
},
|
||||
{
|
||||
d: 'single-quoted, and trailing normal',
|
||||
a: "'a b' c",
|
||||
e: ['a b', 'c']
|
||||
},
|
||||
{
|
||||
d: 'single-quoted, and heading normal',
|
||||
a: "c 'a b'",
|
||||
e: ['c', 'a b']
|
||||
},
|
||||
{
|
||||
d: 'escaped whitespaces',
|
||||
a: 'a\\ b',
|
||||
e: ['a b']
|
||||
},
|
||||
{
|
||||
d: 'escaped whitespaces, and trailing normal',
|
||||
a: 'a\\ b c',
|
||||
e: ['a b', 'c']
|
||||
},
|
||||
{
|
||||
d: 'escaped whitespaces, and heading normal',
|
||||
a: 'c a\\ b',
|
||||
e: ['c', 'a b']
|
||||
},
|
||||
{
|
||||
d: 'non-starting single quote',
|
||||
a: "a' b'",
|
||||
e: ['a b']
|
||||
},
|
||||
{
|
||||
d: 'non-staring single quote with =',
|
||||
a: "--foo='bar baz'",
|
||||
e: ['--foo=bar baz']
|
||||
},
|
||||
{
|
||||
d: 'non-starting double quote',
|
||||
a: 'a" b"',
|
||||
e: ['a b']
|
||||
},
|
||||
{
|
||||
d: 'non-starting double quote with =',
|
||||
a: '--foo="bar baz"',
|
||||
e: ['--foo=bar baz']
|
||||
},
|
||||
{
|
||||
d: 'double-quoted escaped double quote',
|
||||
a: '"bar\\" baz"',
|
||||
e: ['bar" baz']
|
||||
},
|
||||
{
|
||||
d: 'single-quoted escaped double quote, should not over unescaped',
|
||||
a: '\'bar\\" baz\'',
|
||||
e: ['bar\\" baz']
|
||||
},
|
||||
{
|
||||
d: 'signle-quoted escaped single quote, should throw',
|
||||
a: "'bar\' baz'",
|
||||
throws: true
|
||||
}
|
||||
|
||||
].forEach(({d, a, e, throws, only}) => {
|
||||
const t = only
|
||||
? test.only
|
||||
: test
|
||||
|
||||
t(d, t => {
|
||||
if (throws) {
|
||||
t.throws(() => {
|
||||
split(a)
|
||||
})
|
||||
return
|
||||
}
|
||||
// console.log(split(a), e)
|
||||
t.deepEqual(split(a), e)
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue