Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix "deno test" on windows #599

Closed
wants to merge 10 commits into from
3 changes: 2 additions & 1 deletion .ci/check_source_file_changes.ts
Original file line number Diff line number Diff line change
@@ -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";
lucacasonato marked this conversation as resolved.
Show resolved Hide resolved

/**
* Checks whether any source file is changed since the given start time.
Expand All @@ -11,7 +12,7 @@ async function main(startTime: number): Promise<void> {
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) {
Expand Down
9 changes: 5 additions & 4 deletions testing/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +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 = [
"**/*_test.ts",
"**/*_test.js",
"**/test.ts",
"**/test.js"
join("**", "*_test.ts"),
join("**", "*_test.js"),
join("**", "test.ts"),
join("**", "test.js")
];

/* eslint-disable max-len */
Expand Down
2 changes: 1 addition & 1 deletion testing/runner_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test(async function getMatchingUrlsRemote(): Promise<void> {

test(async function getMatchingUrlsLocal(): Promise<void> {
const urls = await getMatchingUrls(
["fmt/*_test.ts"],
[join("fmt", "*_test.ts")],
lucacasonato marked this conversation as resolved.
Show resolved Hide resolved
["colors*"],
TEST_ROOT_PATH
);
Expand Down
3 changes: 2 additions & 1 deletion xeval/test.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -33,7 +34,7 @@ test(async function xevalCliReplvar(): Promise<void> {
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<void> {
Expand Down