summaryrefslogtreecommitdiff
path: root/flags/tests/dash.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2018-12-21 19:02:52 +0100
committerRyan Dahl <ry@tinyclouds.org>2018-12-21 13:02:52 -0500
commit0b9ab1249b4bc0a7ab34ee68ca9ea71d7cd7d2ff (patch)
treec1326825cf0fde6d58f255ee991012a158bcddf2 /flags/tests/dash.ts
parenta31e44d1c8a5843882b3d974827e857070fd17c1 (diff)
Remove default export from flags module (denoland/deno_std#38)
Original: https://github.com/denoland/deno_std/commit/e674f7575a7a5a845d696416da2abae62525bc3e
Diffstat (limited to 'flags/tests/dash.ts')
-rwxr-xr-xflags/tests/dash.ts20
1 files changed, 10 insertions, 10 deletions
diff --git a/flags/tests/dash.ts b/flags/tests/dash.ts
index 87b3ab480..5a55372c2 100755
--- a/flags/tests/dash.ts
+++ b/flags/tests/dash.ts
@@ -1,28 +1,28 @@
import { test, assertEqual } from "https://deno.land/x/testing/testing.ts";
-import parseArgs from "../index.ts";
+import { parse } from "../index.ts";
test(function hyphen() {
- assertEqual(parseArgs([ '-n', '-' ]), { n: '-', _: [] });
- assertEqual(parseArgs([ '-' ]), { _: [ '-' ] });
- assertEqual(parseArgs([ '-f-' ]), { f: '-', _: [] });
+ assertEqual(parse([ '-n', '-' ]), { n: '-', _: [] });
+ assertEqual(parse([ '-' ]), { _: [ '-' ] });
+ assertEqual(parse([ '-f-' ]), { f: '-', _: [] });
assertEqual(
- parseArgs([ '-b', '-' ], { boolean: 'b' }),
+ parse([ '-b', '-' ], { boolean: 'b' }),
{ b: true, _: [ '-' ] }
);
assertEqual(
- parseArgs([ '-s', '-' ], { string: 's' }),
+ parse([ '-s', '-' ], { string: 's' }),
{ s: '-', _: [] }
);
});
test(function doubleDash() {
- assertEqual(parseArgs([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] });
- assertEqual(parseArgs([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
- assertEqual(parseArgs([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+ assertEqual(parse([ '-a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+ assertEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
+ assertEqual(parse([ '--a', '--', 'b' ]), { a: true, _: [ 'b' ] });
});
test(function moveArgsAfterDoubleDashIntoOwnArray() {
assertEqual(
- parseArgs([ '--name', 'John', 'before', '--', 'after' ], { '--': true }),
+ parse([ '--name', 'John', 'before', '--', 'after' ], { '--': true }),
{ name: 'John', _: [ 'before' ], '--': [ 'after' ] });
});