From e80f14489084d748bb52c4311519f5d0c7696f47 Mon Sep 17 00:00:00 2001 From: Axetroy Date: Wed, 20 Mar 2019 01:24:11 +0800 Subject: [PATCH] move test file out of tests dir in flags module (#293) --- flags/{tests/all_bool.ts => all_bool_test.ts} | 6 ++--- flags/{tests/bool.ts => bool_test.ts} | 6 ++--- flags/{tests/dash.ts => dash_test.ts} | 6 ++--- .../default_bool.ts => default_bool_test.ts} | 6 ++--- flags/{tests/dotted.ts => dotted_test.ts} | 6 ++--- flags/{tests/kv_short.ts => kv_short_test.ts} | 6 ++--- flags/{tests/long.ts => long_test.ts} | 6 ++--- flags/{tests/num.ts => num_test.ts} | 6 ++--- flags/{tests/parse.ts => parse_test.ts} | 6 ++--- flags/{tests/short.ts => short_test.ts} | 6 ++--- .../stop_early.ts => stop_early_test.ts} | 6 ++--- flags/test.ts | 26 +++++++++---------- flags/{tests/unknown.ts => unknown_test.ts} | 6 ++--- .../whitespace.ts => whitespace_test.ts} | 6 ++--- 14 files changed, 52 insertions(+), 52 deletions(-) rename flags/{tests/all_bool.ts => all_bool_test.ts} (84%) rename flags/{tests/bool.ts => bool_test.ts} (96%) rename flags/{tests/dash.ts => dash_test.ts} (86%) rename flags/{tests/default_bool.ts => default_bool_test.ts} (83%) rename flags/{tests/dotted.ts => dotted_test.ts} (81%) rename flags/{tests/kv_short.ts => kv_short_test.ts} (70%) rename flags/{tests/long.ts => long_test.ts} (79%) rename flags/{tests/num.ts => num_test.ts} (85%) rename flags/{tests/parse.ts => parse_test.ts} (96%) rename flags/{tests/short.ts => short_test.ts} (89%) rename flags/{tests/stop_early.ts => stop_early_test.ts} (70%) rename flags/{tests/unknown.ts => unknown_test.ts} (94%) rename flags/{tests/whitespace.ts => whitespace_test.ts} (55%) diff --git a/flags/tests/all_bool.ts b/flags/all_bool_test.ts similarity index 84% rename from flags/tests/all_bool.ts rename to flags/all_bool_test.ts index e88919378c..59779c7792 100755 --- a/flags/tests/all_bool.ts +++ b/flags/all_bool_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; // flag boolean true (default all --args to boolean) test(function flagBooleanTrue() { diff --git a/flags/tests/bool.ts b/flags/bool_test.ts similarity index 96% rename from flags/tests/bool.ts rename to flags/bool_test.ts index bffb1fd34f..820393543f 100755 --- a/flags/tests/bool.ts +++ b/flags/bool_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function flagBooleanDefaultFalse() { const argv = parse(["moo"], { diff --git a/flags/tests/dash.ts b/flags/dash_test.ts similarity index 86% rename from flags/tests/dash.ts rename to flags/dash_test.ts index f70108124b..7d52e4905e 100755 --- a/flags/tests/dash.ts +++ b/flags/dash_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function hyphen() { assertEquals(parse(["-n", "-"]), { n: "-", _: [] }); diff --git a/flags/tests/default_bool.ts b/flags/default_bool_test.ts similarity index 83% rename from flags/tests/default_bool.ts rename to flags/default_bool_test.ts index 43e91c8c02..a1a329074b 100755 --- a/flags/tests/default_bool.ts +++ b/flags/default_bool_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function booleanDefaultTrue() { const argv = parse([], { diff --git a/flags/tests/dotted.ts b/flags/dotted_test.ts similarity index 81% rename from flags/tests/dotted.ts rename to flags/dotted_test.ts index c2179a3a89..d5a4918152 100755 --- a/flags/tests/dotted.ts +++ b/flags/dotted_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function dottedAlias() { const argv = parse(["--a.b", "22"], { diff --git a/flags/tests/kv_short.ts b/flags/kv_short_test.ts similarity index 70% rename from flags/tests/kv_short.ts rename to flags/kv_short_test.ts index b5a216b753..0cd93df02a 100755 --- a/flags/tests/kv_short.ts +++ b/flags/kv_short_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function short() { const argv = parse(["-b=123"]); diff --git a/flags/tests/long.ts b/flags/long_test.ts similarity index 79% rename from flags/tests/long.ts rename to flags/long_test.ts index 04f563d422..fb26a4c07f 100755 --- a/flags/tests/long.ts +++ b/flags/long_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function longOpts() { assertEquals(parse(["--bool"]), { bool: true, _: [] }); diff --git a/flags/tests/num.ts b/flags/num_test.ts similarity index 85% rename from flags/tests/num.ts rename to flags/num_test.ts index b140ea18a5..752e1752fa 100755 --- a/flags/tests/num.ts +++ b/flags/num_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function nums() { const argv = parse([ diff --git a/flags/tests/parse.ts b/flags/parse_test.ts similarity index 96% rename from flags/tests/parse.ts rename to flags/parse_test.ts index a37cd4c631..dbcdb4a863 100755 --- a/flags/tests/parse.ts +++ b/flags/parse_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function _arseArgs() { assertEquals(parse(["--no-moo"]), { moo: false, _: [] }); diff --git a/flags/tests/short.ts b/flags/short_test.ts similarity index 89% rename from flags/tests/short.ts rename to flags/short_test.ts index 8c0d06d3a6..700902dd74 100755 --- a/flags/tests/short.ts +++ b/flags/short_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function numbericShortArgs() { assertEquals(parse(["-n123"]), { n: 123, _: [] }); diff --git a/flags/tests/stop_early.ts b/flags/stop_early_test.ts similarity index 70% rename from flags/tests/stop_early.ts rename to flags/stop_early_test.ts index 799b16b78f..70194adfe4 100755 --- a/flags/tests/stop_early.ts +++ b/flags/stop_early_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; // stops parsing on the first non-option when stopEarly is set test(function stopParsing() { diff --git a/flags/test.ts b/flags/test.ts index 66aa8d2cd9..f8e928555b 100644 --- a/flags/test.ts +++ b/flags/test.ts @@ -1,14 +1,14 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import "./tests/all_bool.ts"; -import "./tests/bool.ts"; -import "./tests/dash.ts"; -import "./tests/default_bool.ts"; -import "./tests/dotted.ts"; -import "./tests/kv_short.ts"; -import "./tests/long.ts"; -import "./tests/num.ts"; -import "./tests/parse.ts"; -import "./tests/short.ts"; -import "./tests/stop_early.ts"; -import "./tests/unknown.ts"; -import "./tests/whitespace.ts"; +import "./all_bool_test.ts"; +import "./bool_test.ts"; +import "./dash_test.ts"; +import "./default_bool_test.ts"; +import "./dotted_test.ts"; +import "./kv_short_test.ts"; +import "./long_test.ts"; +import "./num_test.ts"; +import "./parse_test.ts"; +import "./short_test.ts"; +import "./stop_early_test.ts"; +import "./unknown_test.ts"; +import "./whitespace_test.ts"; diff --git a/flags/tests/unknown.ts b/flags/unknown_test.ts similarity index 94% rename from flags/tests/unknown.ts rename to flags/unknown_test.ts index cd944746f0..fcb47e36b4 100755 --- a/flags/tests/unknown.ts +++ b/flags/unknown_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function booleanAndAliasIsNotUnknown() { const unknown = []; diff --git a/flags/tests/whitespace.ts b/flags/whitespace_test.ts similarity index 55% rename from flags/tests/whitespace.ts rename to flags/whitespace_test.ts index 54ff067c7c..f0f24703c6 100755 --- a/flags/tests/whitespace.ts +++ b/flags/whitespace_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. -import { test } from "../../testing/mod.ts"; -import { assertEquals } from "../../testing/asserts.ts"; -import { parse } from "../mod.ts"; +import { test } from "../testing/mod.ts"; +import { assertEquals } from "../testing/asserts.ts"; +import { parse } from "./mod.ts"; test(function whitespaceShouldBeWhitespace() { assertEquals(parse(["-x", "\t"]).x, "\t");