X-Git-Url: https://git.josue.xyz/?a=blobdiff_plain;f=node_modules%2Fnode-static%2Fnode_modules%2Foptimist%2Ftest%2Fdash.js;fp=node_modules%2Fnode-static%2Fnode_modules%2Foptimist%2Ftest%2Fdash.js;h=af8ed6fc64b74fa259222bd45316cd06fed9e6fb;hb=0f4e331e6d75c244e978860b62a6e1aed8d446e0;hp=0000000000000000000000000000000000000000;hpb=0cb383f1c0646575a831f4f812cd85c9e24d9a18;p=VSoRC%2F.git diff --git a/node_modules/node-static/node_modules/optimist/test/dash.js b/node_modules/node-static/node_modules/optimist/test/dash.js new file mode 100644 index 0000000..af8ed6f --- /dev/null +++ b/node_modules/node-static/node_modules/optimist/test/dash.js @@ -0,0 +1,31 @@ +var optimist = require('../index'); +var test = require('tap').test; + +test('-', function (t) { + t.plan(5); + t.deepEqual( + fix(optimist.parse([ '-n', '-' ])), + { n: '-', _: [] } + ); + t.deepEqual( + fix(optimist.parse([ '-' ])), + { _: [ '-' ] } + ); + t.deepEqual( + fix(optimist.parse([ '-f-' ])), + { f: '-', _: [] } + ); + t.deepEqual( + fix(optimist([ '-b', '-' ]).boolean('b').argv), + { b: true, _: [ '-' ] } + ); + t.deepEqual( + fix(optimist([ '-s', '-' ]).string('s').argv), + { s: '-', _: [] } + ); +}); + +function fix (obj) { + delete obj.$0; + return obj; +}