From 2c8d80f13eb0768aec0f904a038cc7f2967a4e10 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 16 Sep 2019 14:03:50 +0200 Subject: [PATCH 1/9] Potential fix for windows runner match issue --- testing/runner.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/testing/runner.ts b/testing/runner.ts index 414fb1f56787..255f2d095885 100755 --- a/testing/runner.ts +++ b/testing/runner.ts @@ -5,13 +5,19 @@ import { glob, isGlob, walk } from "../fs/mod.ts"; import { runTests } from "./mod.ts"; const { args, cwd } = Deno; -const DEFAULT_GLOBS = [ +const DEFAULT_GLOBS = Deno.build.os == "win" ? [ + "**\\*_test.ts", + "**\\*_test.js", + "**\\test.ts", + "**\\test.js" +] : [ "**/*_test.ts", "**/*_test.js", "**/test.ts", "**/test.js" ]; + /* eslint-disable max-len */ function showHelp(): void { console.log(`Deno test runner From d8b225f3d4caaf10858233f015ed6ef3edb70b81 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 16 Sep 2019 14:20:55 +0200 Subject: [PATCH 2/9] Ran formatter --- testing/runner.ts | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/testing/runner.ts b/testing/runner.ts index 255f2d095885..60a2ed009fb4 100755 --- a/testing/runner.ts +++ b/testing/runner.ts @@ -5,18 +5,10 @@ import { glob, isGlob, walk } from "../fs/mod.ts"; import { runTests } from "./mod.ts"; const { args, cwd } = Deno; -const DEFAULT_GLOBS = Deno.build.os == "win" ? [ - "**\\*_test.ts", - "**\\*_test.js", - "**\\test.ts", - "**\\test.js" -] : [ - "**/*_test.ts", - "**/*_test.js", - "**/test.ts", - "**/test.js" -]; - +const DEFAULT_GLOBS = + Deno.build.os == "win" + ? ["**\\*_test.ts", "**\\*_test.js", "**\\test.ts", "**\\test.js"] + : ["**/*_test.ts", "**/*_test.js", "**/test.ts", "**/test.js"]; /* eslint-disable max-len */ function showHelp(): void { From e02d4f69a8e9da2dbc7c05f8ee98024f7b200236 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 16 Sep 2019 16:05:29 +0200 Subject: [PATCH 3/9] Use fs.path.join to build platform specific path --- testing/runner.ts | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/testing/runner.ts b/testing/runner.ts index 255f2d095885..94444010848b 100755 --- a/testing/runner.ts +++ b/testing/runner.ts @@ -3,18 +3,14 @@ import { parse } from "../flags/mod.ts"; import { glob, isGlob, walk } from "../fs/mod.ts"; import { runTests } from "./mod.ts"; +import { join } from "../fs/path/mod.ts"; const { args, cwd } = Deno; -const DEFAULT_GLOBS = Deno.build.os == "win" ? [ - "**\\*_test.ts", - "**\\*_test.js", - "**\\test.ts", - "**\\test.js" -] : [ - "**/*_test.ts", - "**/*_test.js", - "**/test.ts", - "**/test.js" +const DEFAULT_GLOBS = [ + join("**","*_test.ts" ), + join("**","*_test.js" ), + join("**","test.ts" ), + join("**","test.ts" ), ]; From 346625f57c64576dbb5bcd8dc6f2c70541788f5f Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 19 Sep 2019 19:26:51 +0200 Subject: [PATCH 4/9] ts -> js --- testing/runner.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/runner.ts b/testing/runner.ts index b8ec1e72d968..29c756491480 100755 --- a/testing/runner.ts +++ b/testing/runner.ts @@ -10,7 +10,7 @@ const DEFAULT_GLOBS = [ join("**", "*_test.ts"), join("**", "*_test.js"), join("**", "test.ts"), - join("**", "test.ts") + join("**", "test.js") ]; /* eslint-disable max-len */ From f7594657145920f90f42957c0214a712741d82df Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 19 Sep 2019 19:53:31 +0200 Subject: [PATCH 5/9] replaced some \n in EOL --- .ci/check_source_file_changes.ts | 3 ++- testing/runner_test.ts | 2 +- xeval/test.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.ci/check_source_file_changes.ts b/.ci/check_source_file_changes.ts index 6aac5d645cb1..1e829865c31e 100644 --- a/.ci/check_source_file_changes.ts +++ b/.ci/check_source_file_changes.ts @@ -1,6 +1,7 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import { xrun } from "../prettier/util.ts"; import { red, green } from "../fmt/colors.ts"; +import { EOL } from "../fs/path/constants.ts"; /** * Checks whether any source file is changed since the given start time. @@ -11,7 +12,7 @@ async function main(startTime: number): Promise { const changed = new TextDecoder() .decode(await xrun({ args: ["git", "ls-files"], stdout: "piped" }).output()) .trim() - .split("\n") + .split(EOL) .filter(file => { const stat = Deno.lstatSync(file); if (stat != null) { diff --git a/testing/runner_test.ts b/testing/runner_test.ts index 0e2289187baf..f4f1b19f503a 100644 --- a/testing/runner_test.ts +++ b/testing/runner_test.ts @@ -22,7 +22,7 @@ test(async function getMatchingUrlsRemote(): Promise { test(async function getMatchingUrlsLocal(): Promise { const urls = await getMatchingUrls( - ["fmt/*_test.ts"], + [join("fmt", "*_test.ts")], ["colors*"], TEST_ROOT_PATH ); diff --git a/xeval/test.ts b/xeval/test.ts index 6b3e64ff4067..5fd252f4c89d 100644 --- a/xeval/test.ts +++ b/xeval/test.ts @@ -1,6 +1,7 @@ import { xeval } from "./mod.ts"; import { stringsReader } from "../io/util.ts"; import { decode, encode } from "../strings/mod.ts"; +import { EOL } from "../fs/path/constants.ts"; import { assertEquals, assertStrContains } from "../testing/asserts.ts"; import { test } from "../testing/mod.ts"; const { execPath, run } = Deno; @@ -33,7 +34,7 @@ test(async function xevalCliReplvar(): Promise { await p.stdin!.write(encode("hello")); await p.stdin!.close(); assertEquals(await p.status(), { code: 0, success: true }); - assertEquals(decode(await p.output()), "hello\n"); + assertEquals(decode(await p.output()), "hello"+EOL); }); test(async function xevalCliSyntaxError(): Promise { From ec90fe4a5facc4b70cec469757ac061aa80429cd Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 19 Sep 2019 19:55:28 +0200 Subject: [PATCH 6/9] Fixed format --- xeval/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xeval/test.ts b/xeval/test.ts index 5fd252f4c89d..8759bf9c5ea0 100644 --- a/xeval/test.ts +++ b/xeval/test.ts @@ -34,7 +34,7 @@ test(async function xevalCliReplvar(): Promise { await p.stdin!.write(encode("hello")); await p.stdin!.close(); assertEquals(await p.status(), { code: 0, success: true }); - assertEquals(decode(await p.output()), "hello"+EOL); + assertEquals(decode(await p.output()), "hello" + EOL); }); test(async function xevalCliSyntaxError(): Promise { From 9cf49985d87f40f0956460e034deae05d8c51375 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 19 Sep 2019 20:43:09 +0200 Subject: [PATCH 7/9] remove join in getMatchingUrlsLocal --- testing/runner_test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/runner_test.ts b/testing/runner_test.ts index f4f1b19f503a..c57ede375258 100644 --- a/testing/runner_test.ts +++ b/testing/runner_test.ts @@ -22,7 +22,7 @@ test(async function getMatchingUrlsRemote(): Promise { test(async function getMatchingUrlsLocal(): Promise { const urls = await getMatchingUrls( - [join("fmt", "*_test.ts")], + ["*_test.ts"], ["colors*"], TEST_ROOT_PATH ); From 2aee99ecbdc722144c966f1c4ac434b37549a1a0 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 19 Sep 2019 20:53:10 +0200 Subject: [PATCH 8/9] revert in check_source_file.ts --- .ci/check_source_file_changes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/check_source_file_changes.ts b/.ci/check_source_file_changes.ts index 1e829865c31e..0990e1e0f7ff 100644 --- a/.ci/check_source_file_changes.ts +++ b/.ci/check_source_file_changes.ts @@ -12,7 +12,7 @@ async function main(startTime: number): Promise { const changed = new TextDecoder() .decode(await xrun({ args: ["git", "ls-files"], stdout: "piped" }).output()) .trim() - .split(EOL) + .split("\n") .filter(file => { const stat = Deno.lstatSync(file); if (stat != null) { From e40ebe21cbd37b9a81e5d1762629bb3c8c3840b6 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 19 Sep 2019 21:22:27 +0200 Subject: [PATCH 9/9] removed unused source --- .ci/check_source_file_changes.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/.ci/check_source_file_changes.ts b/.ci/check_source_file_changes.ts index 0990e1e0f7ff..6aac5d645cb1 100644 --- a/.ci/check_source_file_changes.ts +++ b/.ci/check_source_file_changes.ts @@ -1,7 +1,6 @@ // Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. import { xrun } from "../prettier/util.ts"; import { red, green } from "../fmt/colors.ts"; -import { EOL } from "../fs/path/constants.ts"; /** * Checks whether any source file is changed since the given start time.