summaryrefslogtreecommitdiff
path: root/flags/tests
diff options
context:
space:
mode:
Diffstat (limited to 'flags/tests')
-rwxr-xr-xflags/tests/all_bool.ts10
-rwxr-xr-xflags/tests/bool.ts46
-rwxr-xr-xflags/tests/dash.ts31
-rwxr-xr-xflags/tests/default_bool.ts10
-rwxr-xr-xflags/tests/dotted.ts12
-rwxr-xr-xflags/tests/kv_short.ts6
-rwxr-xr-xflags/tests/long.ts12
-rwxr-xr-xflags/tests/num.ts22
-rwxr-xr-xflags/tests/parse.ts92
-rwxr-xr-xflags/tests/short.ts22
-rwxr-xr-xflags/tests/stop_early.ts4
-rwxr-xr-xflags/tests/unknown.ts16
-rwxr-xr-xflags/tests/whitespace.ts4
13 files changed, 145 insertions, 142 deletions
diff --git a/flags/tests/all_bool.ts b/flags/tests/all_bool.ts
index 7f19e5303..e88919378 100755
--- a/flags/tests/all_bool.ts
+++ b/flags/tests/all_bool.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
// flag boolean true (default all --args to boolean)
@@ -9,12 +9,12 @@ test(function flagBooleanTrue() {
boolean: true
});
- assertEq(argv, {
+ assertEquals(argv, {
honk: true,
_: ["moo", "cow"]
});
- assertEq(typeof argv.honk, "boolean");
+ assertEquals(typeof argv.honk, "boolean");
});
// flag boolean true only affects double hyphen arguments without equals signs
@@ -23,12 +23,12 @@ test(function flagBooleanTrueOnlyAffectsDoubleDash() {
boolean: true
});
- assertEq(argv, {
+ assertEquals(argv, {
honk: true,
tacos: "good",
p: 55,
_: ["moo", "cow"]
});
- assertEq(typeof argv.honk, "boolean");
+ assertEquals(typeof argv.honk, "boolean");
});
diff --git a/flags/tests/bool.ts b/flags/tests/bool.ts
index 1146698fa..321dbb1e9 100755
--- a/flags/tests/bool.ts
+++ b/flags/tests/bool.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function flagBooleanDefaultFalse() {
@@ -9,14 +9,14 @@ test(function flagBooleanDefaultFalse() {
default: { verbose: false, t: false }
});
- assertEq(argv, {
+ assertEquals(argv, {
verbose: false,
t: false,
_: ["moo"]
});
- assertEq(typeof argv.verbose, "boolean");
- assertEq(typeof argv.t, "boolean");
+ assertEquals(typeof argv.verbose, "boolean");
+ assertEquals(typeof argv.t, "boolean");
});
test(function booleanGroups() {
@@ -24,16 +24,16 @@ test(function booleanGroups() {
boolean: ["x", "y", "z"]
});
- assertEq(argv, {
+ assertEquals(argv, {
x: true,
y: false,
z: true,
_: ["one", "two", "three"]
});
- assertEq(typeof argv.x, "boolean");
- assertEq(typeof argv.y, "boolean");
- assertEq(typeof argv.z, "boolean");
+ assertEquals(typeof argv.x, "boolean");
+ assertEquals(typeof argv.y, "boolean");
+ assertEquals(typeof argv.z, "boolean");
});
test(function booleanAndAliasWithChainableApi() {
@@ -56,8 +56,8 @@ test(function booleanAndAliasWithChainableApi() {
_: ["derp"]
};
- assertEq(aliasedArgv, expected);
- assertEq(propertyArgv, expected);
+ assertEquals(aliasedArgv, expected);
+ assertEquals(propertyArgv, expected);
});
test(function booleanAndAliasWithOptionsHash() {
@@ -74,8 +74,8 @@ test(function booleanAndAliasWithOptionsHash() {
h: true,
_: ["derp"]
};
- assertEq(aliasedArgv, expected);
- assertEq(propertyArgv, expected);
+ assertEquals(aliasedArgv, expected);
+ assertEquals(propertyArgv, expected);
});
test(function booleanAndAliasArrayWithOptionsHash() {
@@ -95,9 +95,9 @@ test(function booleanAndAliasArrayWithOptionsHash() {
h: true,
_: ["derp"]
};
- assertEq(aliasedArgv, expected);
- assertEq(propertyArgv, expected);
- assertEq(altPropertyArgv, expected);
+ assertEquals(aliasedArgv, expected);
+ assertEquals(propertyArgv, expected);
+ assertEquals(altPropertyArgv, expected);
});
test(function booleanAndAliasUsingExplicitTrue() {
@@ -115,8 +115,8 @@ test(function booleanAndAliasUsingExplicitTrue() {
_: []
};
- assertEq(aliasedArgv, expected);
- assertEq(propertyArgv, expected);
+ assertEquals(aliasedArgv, expected);
+ assertEquals(propertyArgv, expected);
});
// regression, see https://github.com/substack/node-optimist/issues/71
@@ -126,15 +126,15 @@ test(function booleanAndNonBoolean() {
boolean: "boool"
});
- assertEq(parsed.boool, true);
- assertEq(parsed.other, "true");
+ assertEquals(parsed.boool, true);
+ assertEquals(parsed.other, "true");
const parsed2 = parse(["--boool", "--other=false"], {
boolean: "boool"
});
- assertEq(parsed2.boool, true);
- assertEq(parsed2.other, "false");
+ assertEquals(parsed2.boool, true);
+ assertEquals(parsed2.other, "false");
});
test(function booleanParsingTrue() {
@@ -145,7 +145,7 @@ test(function booleanParsingTrue() {
boolean: ["boool"]
});
- assertEq(parsed.boool, true);
+ assertEquals(parsed.boool, true);
});
test(function booleanParsingFalse() {
@@ -156,5 +156,5 @@ test(function booleanParsingFalse() {
boolean: ["boool"]
});
- assertEq(parsed.boool, false);
+ assertEquals(parsed.boool, false);
});
diff --git a/flags/tests/dash.ts b/flags/tests/dash.ts
index 13fa153cb..f70108124 100755
--- a/flags/tests/dash.ts
+++ b/flags/tests/dash.ts
@@ -1,26 +1,29 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function hyphen() {
- assertEq(parse(["-n", "-"]), { n: "-", _: [] });
- assertEq(parse(["-"]), { _: ["-"] });
- assertEq(parse(["-f-"]), { f: "-", _: [] });
- assertEq(parse(["-b", "-"], { boolean: "b" }), { b: true, _: ["-"] });
- assertEq(parse(["-s", "-"], { string: "s" }), { s: "-", _: [] });
+ assertEquals(parse(["-n", "-"]), { n: "-", _: [] });
+ assertEquals(parse(["-"]), { _: ["-"] });
+ assertEquals(parse(["-f-"]), { f: "-", _: [] });
+ assertEquals(parse(["-b", "-"], { boolean: "b" }), { b: true, _: ["-"] });
+ assertEquals(parse(["-s", "-"], { string: "s" }), { s: "-", _: [] });
});
test(function doubleDash() {
- assertEq(parse(["-a", "--", "b"]), { a: true, _: ["b"] });
- assertEq(parse(["--a", "--", "b"]), { a: true, _: ["b"] });
- assertEq(parse(["--a", "--", "b"]), { a: true, _: ["b"] });
+ assertEquals(parse(["-a", "--", "b"]), { a: true, _: ["b"] });
+ assertEquals(parse(["--a", "--", "b"]), { a: true, _: ["b"] });
+ assertEquals(parse(["--a", "--", "b"]), { a: true, _: ["b"] });
});
test(function moveArgsAfterDoubleDashIntoOwnArray() {
- assertEq(parse(["--name", "John", "before", "--", "after"], { "--": true }), {
- name: "John",
- _: ["before"],
- "--": ["after"]
- });
+ assertEquals(
+ parse(["--name", "John", "before", "--", "after"], { "--": true }),
+ {
+ name: "John",
+ _: ["before"],
+ "--": ["after"]
+ }
+ );
});
diff --git a/flags/tests/default_bool.ts b/flags/tests/default_bool.ts
index 9c4855c7d..43e91c8c0 100755
--- a/flags/tests/default_bool.ts
+++ b/flags/tests/default_bool.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function booleanDefaultTrue() {
@@ -8,7 +8,7 @@ test(function booleanDefaultTrue() {
boolean: "sometrue",
default: { sometrue: true }
});
- assertEq(argv.sometrue, true);
+ assertEquals(argv.sometrue, true);
});
test(function booleanDefaultFalse() {
@@ -16,7 +16,7 @@ test(function booleanDefaultFalse() {
boolean: "somefalse",
default: { somefalse: false }
});
- assertEq(argv.somefalse, false);
+ assertEquals(argv.somefalse, false);
});
test(function booleanDefaultNull() {
@@ -24,10 +24,10 @@ test(function booleanDefaultNull() {
boolean: "maybe",
default: { maybe: null }
});
- assertEq(argv.maybe, null);
+ assertEquals(argv.maybe, null);
const argv2 = parse(["--maybe"], {
boolean: "maybe",
default: { maybe: null }
});
- assertEq(argv2.maybe, true);
+ assertEquals(argv2.maybe, true);
});
diff --git a/flags/tests/dotted.ts b/flags/tests/dotted.ts
index 55addefe7..c2179a3a8 100755
--- a/flags/tests/dotted.ts
+++ b/flags/tests/dotted.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function dottedAlias() {
@@ -8,17 +8,17 @@ test(function dottedAlias() {
default: { "a.b": 11 },
alias: { "a.b": "aa.bb" }
});
- assertEq(argv.a.b, 22);
- assertEq(argv.aa.bb, 22);
+ assertEquals(argv.a.b, 22);
+ assertEquals(argv.aa.bb, 22);
});
test(function dottedDefault() {
const argv = parse("", { default: { "a.b": 11 }, alias: { "a.b": "aa.bb" } });
- assertEq(argv.a.b, 11);
- assertEq(argv.aa.bb, 11);
+ assertEquals(argv.a.b, 11);
+ assertEquals(argv.aa.bb, 11);
});
test(function dottedDefaultWithNoAlias() {
const argv = parse("", { default: { "a.b": 11 } });
- assertEq(argv.a.b, 11);
+ assertEquals(argv.a.b, 11);
});
diff --git a/flags/tests/kv_short.ts b/flags/tests/kv_short.ts
index 967c8a1db..b5a216b75 100755
--- a/flags/tests/kv_short.ts
+++ b/flags/tests/kv_short.ts
@@ -1,14 +1,14 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function short() {
const argv = parse(["-b=123"]);
- assertEq(argv, { b: 123, _: [] });
+ assertEquals(argv, { b: 123, _: [] });
});
test(function multiShort() {
const argv = parse(["-a=whatever", "-b=robots"]);
- assertEq(argv, { a: "whatever", b: "robots", _: [] });
+ assertEquals(argv, { a: "whatever", b: "robots", _: [] });
});
diff --git a/flags/tests/long.ts b/flags/tests/long.ts
index a67febe19..04f563d42 100755
--- a/flags/tests/long.ts
+++ b/flags/tests/long.ts
@@ -1,18 +1,18 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function longOpts() {
- assertEq(parse(["--bool"]), { bool: true, _: [] });
- assertEq(parse(["--pow", "xixxle"]), { pow: "xixxle", _: [] });
- assertEq(parse(["--pow=xixxle"]), { pow: "xixxle", _: [] });
- assertEq(parse(["--host", "localhost", "--port", "555"]), {
+ assertEquals(parse(["--bool"]), { bool: true, _: [] });
+ assertEquals(parse(["--pow", "xixxle"]), { pow: "xixxle", _: [] });
+ assertEquals(parse(["--pow=xixxle"]), { pow: "xixxle", _: [] });
+ assertEquals(parse(["--host", "localhost", "--port", "555"]), {
host: "localhost",
port: 555,
_: []
});
- assertEq(parse(["--host=localhost", "--port=555"]), {
+ assertEquals(parse(["--host=localhost", "--port=555"]), {
host: "localhost",
port: 555,
_: []
diff --git a/flags/tests/num.ts b/flags/tests/num.ts
index 9e9e2a3c4..b140ea18a 100755
--- a/flags/tests/num.ts
+++ b/flags/tests/num.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function nums() {
@@ -17,7 +17,7 @@ test(function nums() {
"0xdeadbeef",
"789"
]);
- assertEq(argv, {
+ assertEquals(argv, {
x: 1234,
y: 5.67,
z: 1e7,
@@ -25,17 +25,17 @@ test(function nums() {
hex: 0xdeadbeef,
_: [789]
});
- assertEq(typeof argv.x, "number");
- assertEq(typeof argv.y, "number");
- assertEq(typeof argv.z, "number");
- assertEq(typeof argv.w, "string");
- assertEq(typeof argv.hex, "number");
- assertEq(typeof argv._[0], "number");
+ assertEquals(typeof argv.x, "number");
+ assertEquals(typeof argv.y, "number");
+ assertEquals(typeof argv.z, "number");
+ assertEquals(typeof argv.w, "string");
+ assertEquals(typeof argv.hex, "number");
+ assertEquals(typeof argv._[0], "number");
});
test(function alreadyNumber() {
const argv = parse(["-x", 1234, 789]);
- assertEq(argv, { x: 1234, _: [789] });
- assertEq(typeof argv.x, "number");
- assertEq(typeof argv._[0], "number");
+ assertEquals(argv, { x: 1234, _: [789] });
+ assertEquals(typeof argv.x, "number");
+ assertEquals(typeof argv._[0], "number");
});
diff --git a/flags/tests/parse.ts b/flags/tests/parse.ts
index d58c67029..73bdb7c3b 100755
--- a/flags/tests/parse.ts
+++ b/flags/tests/parse.ts
@@ -1,18 +1,18 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function _arseArgs() {
- assertEq(parse(["--no-moo"]), { moo: false, _: [] });
- assertEq(parse(["-v", "a", "-v", "b", "-v", "c"]), {
+ assertEquals(parse(["--no-moo"]), { moo: false, _: [] });
+ assertEquals(parse(["-v", "a", "-v", "b", "-v", "c"]), {
v: ["a", "b", "c"],
_: []
});
});
test(function comprehensive() {
- assertEq(
+ assertEquals(
parse([
"--name=meowmers",
"bare",
@@ -50,8 +50,8 @@ test(function comprehensive() {
test(function flagBoolean() {
const argv = parse(["-t", "moo"], { boolean: "t" });
- assertEq(argv, { t: true, _: ["moo"] });
- assertEq(typeof argv.t, "boolean");
+ assertEquals(argv, { t: true, _: ["moo"] });
+ assertEquals(typeof argv.t, "boolean");
});
test(function flagBooleanValue() {
@@ -60,63 +60,63 @@ test(function flagBooleanValue() {
default: { verbose: true }
});
- assertEq(argv, {
+ assertEquals(argv, {
verbose: false,
t: true,
_: ["moo"]
});
- assertEq(typeof argv.verbose, "boolean");
- assertEq(typeof argv.t, "boolean");
+ assertEquals(typeof argv.verbose, "boolean");
+ assertEquals(typeof argv.t, "boolean");
});
test(function newlinesInParams() {
const args = parse(["-s", "X\nX"]);
- assertEq(args, { _: [], s: "X\nX" });
+ assertEquals(args, { _: [], s: "X\nX" });
// reproduce in bash:
// VALUE="new
// line"
// deno program.js --s="$VALUE"
const args2 = parse(["--s=X\nX"]);
- assertEq(args2, { _: [], s: "X\nX" });
+ assertEquals(args2, { _: [], s: "X\nX" });
});
test(function strings() {
const s = parse(["-s", "0001234"], { string: "s" }).s;
- assertEq(s, "0001234");
- assertEq(typeof s, "string");
+ assertEquals(s, "0001234");
+ assertEquals(typeof s, "string");
const x = parse(["-x", "56"], { string: "x" }).x;
- assertEq(x, "56");
- assertEq(typeof x, "string");
+ assertEquals(x, "56");
+ assertEquals(typeof x, "string");
});
test(function stringArgs() {
const s = parse([" ", " "], { string: "_" })._;
- assertEq(s.length, 2);
- assertEq(typeof s[0], "string");
- assertEq(s[0], " ");
- assertEq(typeof s[1], "string");
- assertEq(s[1], " ");
+ assertEquals(s.length, 2);
+ assertEquals(typeof s[0], "string");
+ assertEquals(s[0], " ");
+ assertEquals(typeof s[1], "string");
+ assertEquals(s[1], " ");
});
test(function emptyStrings() {
const s = parse(["-s"], { string: "s" }).s;
- assertEq(s, "");
- assertEq(typeof s, "string");
+ assertEquals(s, "");
+ assertEquals(typeof s, "string");
const str = parse(["--str"], { string: "str" }).str;
- assertEq(str, "");
- assertEq(typeof str, "string");
+ assertEquals(str, "");
+ assertEquals(typeof str, "string");
const letters = parse(["-art"], {
string: ["a", "t"]
});
- assertEq(letters.a, "");
- assertEq(letters.r, true);
- assertEq(letters.t, "");
+ assertEquals(letters.a, "");
+ assertEquals(letters.r, true);
+ assertEquals(letters.t, "");
});
test(function stringAndAlias() {
@@ -125,25 +125,25 @@ test(function stringAndAlias() {
alias: { s: "str" }
});
- assertEq(x.str, "000123");
- assertEq(typeof x.str, "string");
- assertEq(x.s, "000123");
- assertEq(typeof x.s, "string");
+ assertEquals(x.str, "000123");
+ assertEquals(typeof x.str, "string");
+ assertEquals(x.s, "000123");
+ assertEquals(typeof x.s, "string");
const y = parse(["-s", "000123"], {
string: "str",
alias: { str: "s" }
});
- assertEq(y.str, "000123");
- assertEq(typeof y.str, "string");
- assertEq(y.s, "000123");
- assertEq(typeof y.s, "string");
+ assertEquals(y.str, "000123");
+ assertEquals(typeof y.str, "string");
+ assertEquals(y.s, "000123");
+ assertEquals(typeof y.s, "string");
});
test(function slashBreak() {
- assertEq(parse(["-I/foo/bar/baz"]), { I: "/foo/bar/baz", _: [] });
- assertEq(parse(["-xyz/foo/bar/baz"]), {
+ assertEquals(parse(["-I/foo/bar/baz"]), { I: "/foo/bar/baz", _: [] });
+ assertEquals(parse(["-xyz/foo/bar/baz"]), {
x: true,
y: true,
z: "/foo/bar/baz",
@@ -155,19 +155,19 @@ test(function alias() {
const argv = parse(["-f", "11", "--zoom", "55"], {
alias: { z: "zoom" }
});
- assertEq(argv.zoom, 55);
- assertEq(argv.z, argv.zoom);
- assertEq(argv.f, 11);
+ assertEquals(argv.zoom, 55);
+ assertEquals(argv.z, argv.zoom);
+ assertEquals(argv.f, 11);
});
test(function multiAlias() {
const argv = parse(["-f", "11", "--zoom", "55"], {
alias: { z: ["zm", "zoom"] }
});
- assertEq(argv.zoom, 55);
- assertEq(argv.z, argv.zoom);
- assertEq(argv.z, argv.zm);
- assertEq(argv.f, 11);
+ assertEquals(argv.zoom, 55);
+ assertEquals(argv.z, argv.zoom);
+ assertEquals(argv.z, argv.zm);
+ assertEquals(argv.f, 11);
});
test(function nestedDottedObjects() {
@@ -182,7 +182,7 @@ test(function nestedDottedObjects() {
"--beep.boop"
]);
- assertEq(argv.foo, {
+ assertEquals(argv.foo, {
bar: 3,
baz: 4,
quux: {
@@ -190,5 +190,5 @@ test(function nestedDottedObjects() {
o_O: true
}
});
- assertEq(argv.beep, { boop: true });
+ assertEquals(argv.beep, { boop: true });
});
diff --git a/flags/tests/short.ts b/flags/tests/short.ts
index 48462af2f..8c0d06d3a 100755
--- a/flags/tests/short.ts
+++ b/flags/tests/short.ts
@@ -1,26 +1,26 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function numbericShortArgs() {
- assertEq(parse(["-n123"]), { n: 123, _: [] });
- assertEq(parse(["-123", "456"]), { 1: true, 2: true, 3: 456, _: [] });
+ assertEquals(parse(["-n123"]), { n: 123, _: [] });
+ assertEquals(parse(["-123", "456"]), { 1: true, 2: true, 3: 456, _: [] });
});
test(function short() {
- assertEq(parse(["-b"]), { b: true, _: [] });
- assertEq(parse(["foo", "bar", "baz"]), { _: ["foo", "bar", "baz"] });
- assertEq(parse(["-cats"]), { c: true, a: true, t: true, s: true, _: [] });
- assertEq(parse(["-cats", "meow"]), {
+ assertEquals(parse(["-b"]), { b: true, _: [] });
+ assertEquals(parse(["foo", "bar", "baz"]), { _: ["foo", "bar", "baz"] });
+ assertEquals(parse(["-cats"]), { c: true, a: true, t: true, s: true, _: [] });
+ assertEquals(parse(["-cats", "meow"]), {
c: true,
a: true,
t: true,
s: "meow",
_: []
});
- assertEq(parse(["-h", "localhost"]), { h: "localhost", _: [] });
- assertEq(parse(["-h", "localhost", "-p", "555"]), {
+ assertEquals(parse(["-h", "localhost"]), { h: "localhost", _: [] });
+ assertEquals(parse(["-h", "localhost", "-p", "555"]), {
h: "localhost",
p: 555,
_: []
@@ -28,7 +28,7 @@ test(function short() {
});
test(function mixedShortBoolAndCapture() {
- assertEq(parse(["-h", "localhost", "-fp", "555", "script.js"]), {
+ assertEquals(parse(["-h", "localhost", "-fp", "555", "script.js"]), {
f: true,
p: 555,
h: "localhost",
@@ -37,7 +37,7 @@ test(function mixedShortBoolAndCapture() {
});
test(function shortAndLong() {
- assertEq(parse(["-h", "localhost", "-fp", "555", "script.js"]), {
+ assertEquals(parse(["-h", "localhost", "-fp", "555", "script.js"]), {
f: true,
p: 555,
h: "localhost",
diff --git a/flags/tests/stop_early.ts b/flags/tests/stop_early.ts
index 5f320e8b8..799b16b78 100755
--- a/flags/tests/stop_early.ts
+++ b/flags/tests/stop_early.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
// stops parsing on the first non-option when stopEarly is set
@@ -9,7 +9,7 @@ test(function stopParsing() {
stopEarly: true
});
- assertEq(argv, {
+ assertEquals(argv, {
aaa: "bbb",
_: ["ccc", "--ddd"]
});
diff --git a/flags/tests/unknown.ts b/flags/tests/unknown.ts
index f69d55d09..986bc29d8 100755
--- a/flags/tests/unknown.ts
+++ b/flags/tests/unknown.ts
@@ -1,6 +1,6 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function booleanAndAliasIsNotUnknown() {
@@ -19,7 +19,7 @@ test(function booleanAndAliasIsNotUnknown() {
const aliasedArgv = parse(aliased, opts);
const propertyArgv = parse(regular, opts);
- assertEq(unknown, ["--derp", "-d"]);
+ assertEquals(unknown, ["--derp", "-d"]);
});
test(function flagBooleanTrueAnyDoubleHyphenArgumentIsNotUnknown() {
@@ -32,8 +32,8 @@ test(function flagBooleanTrueAnyDoubleHyphenArgumentIsNotUnknown() {
boolean: true,
unknown: unknownFn
});
- assertEq(unknown, ["--tacos=good", "cow", "-p"]);
- assertEq(argv, {
+ assertEquals(unknown, ["--tacos=good", "cow", "-p"]);
+ assertEquals(argv, {
honk: true,
_: []
});
@@ -55,7 +55,7 @@ test(function stringAndAliasIsNotUnkown() {
const aliasedArgv = parse(aliased, opts);
const propertyArgv = parse(regular, opts);
- assertEq(unknown, ["--derp", "-d"]);
+ assertEquals(unknown, ["--derp", "-d"]);
});
test(function defaultAndAliasIsNotUnknown() {
@@ -74,7 +74,7 @@ test(function defaultAndAliasIsNotUnknown() {
const aliasedArgv = parse(aliased, opts);
const propertyArgv = parse(regular, opts);
- assertEq(unknown, []);
+ assertEquals(unknown, []);
});
test(function valueFollowingDoubleHyphenIsNotUnknown() {
@@ -90,8 +90,8 @@ test(function valueFollowingDoubleHyphenIsNotUnknown() {
};
const argv = parse(aliased, opts);
- assertEq(unknown, ["--bad"]);
- assertEq(argv, {
+ assertEquals(unknown, ["--bad"]);
+ assertEquals(argv, {
"--": ["good", "arg"],
_: []
});
diff --git a/flags/tests/whitespace.ts b/flags/tests/whitespace.ts
index 22021e5ea..54ff067c7 100755
--- a/flags/tests/whitespace.ts
+++ b/flags/tests/whitespace.ts
@@ -1,8 +1,8 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
import { test } from "../../testing/mod.ts";
-import { assertEq } from "../../testing/asserts.ts";
+import { assertEquals } from "../../testing/asserts.ts";
import { parse } from "../mod.ts";
test(function whitespaceShouldBeWhitespace() {
- assertEq(parse(["-x", "\t"]).x, "\t");
+ assertEquals(parse(["-x", "\t"]).x, "\t");
});