mirror of
https://github.com/denoland/deno.git
synced 2024-12-24 16:19:12 -05:00
This reverts commit 6e2abb2b13
.
This commit is contained in:
parent
4c6b986f17
commit
e7abb705f9
110 changed files with 207 additions and 139 deletions
|
@ -20,12 +20,11 @@ fn compile_basic() {
|
|||
for _ in 0..2 {
|
||||
let output = context
|
||||
.new_command()
|
||||
.cwd(util::testdata_path())
|
||||
.args_vec([
|
||||
"compile",
|
||||
"--output",
|
||||
&exe.to_string_lossy(),
|
||||
"./compile/welcome.ts",
|
||||
"../../../test_util/std/examples/welcome.ts",
|
||||
])
|
||||
.run();
|
||||
output.assert_exit_code(0);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { partition } from "../../../test_util/std/collections/partition.ts";
|
||||
import { join } from "../../../test_util/std/path/mod.ts";
|
||||
import * as JSONC from "../../../test_util/std/jsonc/mod.ts";
|
||||
import * as JSONC from "../../../test_util/std/encoding/jsonc.ts";
|
||||
/**
|
||||
* The test suite matches the folders inside the `test` folder inside the
|
||||
* node repo
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
import { magenta } from "../../../test_util/std/fmt/colors.ts";
|
||||
import { pooledMap } from "../../../test_util/std/async/pool.ts";
|
||||
import { dirname, fromFileUrl, join } from "../../../test_util/std/path/mod.ts";
|
||||
import { fail } from "../../../test_util/std/assert/mod.ts";
|
||||
import { fail } from "../../../test_util/std/testing/asserts.ts";
|
||||
import {
|
||||
config,
|
||||
getPathsFromTestSuites,
|
||||
|
|
2
cli/tests/testdata/bench/allow_all.ts
vendored
2
cli/tests/testdata/bench/allow_all.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const permissions: Deno.PermissionName[] = [
|
||||
"read",
|
||||
|
|
2
cli/tests/testdata/bench/allow_none.ts
vendored
2
cli/tests/testdata/bench/allow_none.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
import { unreachable } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { unreachable } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const permissions: Deno.PermissionName[] = [
|
||||
"read",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { assertRejects } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertRejects } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const listener = Deno.listenTls({
|
||||
port: Number(Deno.args[0]),
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
import {
|
||||
assertNotEquals as _a,
|
||||
assertStrictEquals as _b,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
|
1
cli/tests/testdata/compile/welcome.ts
vendored
1
cli/tests/testdata/compile/welcome.ts
vendored
|
@ -1 +0,0 @@
|
|||
console.log("Welcome to Deno!");
|
|
@ -1,5 +1,5 @@
|
|||
import { addNumbers } from "./foo.ts";
|
||||
import { assertEquals } from "../../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test("addNumbers works", () => {
|
||||
assertEquals(addNumbers(1, 2), 3);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { addNumbers } from "./foo.ts";
|
||||
import { assertEquals } from "../../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test("addNumbers works", () => {
|
||||
assertEquals(addNumbers(1, 2), 3);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { addNumbers } from "./foo.ts";
|
||||
import { assertEquals } from "../../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test("addNumbers works", () => {
|
||||
assertEquals(addNumbers(1, 2), 3);
|
||||
|
|
|
@ -4,7 +4,9 @@ FNH:0
|
|||
BRF:0
|
||||
BRH:0
|
||||
DA:1,1
|
||||
DA:2,1
|
||||
DA:3,1
|
||||
LH:2
|
||||
LF:2
|
||||
DA:5,1
|
||||
LH:4
|
||||
LF:4
|
||||
end_of_record
|
||||
|
|
|
@ -1 +1 @@
|
|||
cover [WILDCARD]index.ts ... 100.000% (2/2)
|
||||
cover [WILDCARD]index.ts ... 100.000% (4/4)
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
export { assertStrictEquals } from "../../../../../test_util/std/assert/mod.ts";
|
||||
export {
|
||||
assertStrictEquals,
|
||||
} from "../../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
export * from "./interface.ts";
|
||||
|
|
2
cli/tests/testdata/run/045_proxy_test.ts
vendored
2
cli/tests/testdata/run/045_proxy_test.ts
vendored
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { Server } from "../../../../test_util/std/http/server.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const addr = Deno.args[1] || "localhost:4555";
|
||||
|
||||
|
|
2
cli/tests/testdata/run/import_meta/main.ts
vendored
2
cli/tests/testdata/run/import_meta/main.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
import { assertThrows } from "../../../../../test_util/std/assert/mod.ts";
|
||||
import { assertThrows } from "../../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
console.log("main", import.meta.url, import.meta.main);
|
||||
|
||||
|
|
2
cli/tests/testdata/run/onload/imported.ts
vendored
2
cli/tests/testdata/run/onload/imported.ts
vendored
|
@ -1,5 +1,5 @@
|
|||
// deno-lint-ignore-file no-window-prefix
|
||||
import { assert } from "../../../../../test_util/std/assert/mod.ts";
|
||||
import { assert } from "../../../../../test_util/std/testing/asserts.ts";
|
||||
import "./nest_imported.ts";
|
||||
|
||||
const handler = (e: Event) => {
|
||||
|
|
2
cli/tests/testdata/run/onload/main.ts
vendored
2
cli/tests/testdata/run/onload/main.ts
vendored
|
@ -1,5 +1,5 @@
|
|||
// deno-lint-ignore-file no-window-prefix no-prototype-builtins
|
||||
import { assert } from "../../../../../test_util/std/assert/mod.ts";
|
||||
import { assert } from "../../../../../test_util/std/testing/asserts.ts";
|
||||
import "./imported.ts";
|
||||
|
||||
assert(window.hasOwnProperty("onload"));
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// deno-lint-ignore-file no-window-prefix
|
||||
import { assert } from "../../../../../test_util/std/assert/mod.ts";
|
||||
import { assert } from "../../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const handler = (e: Event) => {
|
||||
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
|
||||
|
|
5
cli/tests/testdata/run/tls_connecttls.js
vendored
5
cli/tests/testdata/run/tls_connecttls.js
vendored
|
@ -1,5 +1,8 @@
|
|||
import { deferred } from "../../../../test_util/std/async/deferred.ts";
|
||||
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { BufReader, BufWriter } from "../../../../test_util/std/io/mod.ts";
|
||||
import { TextProtoReader } from "./textproto.ts";
|
||||
|
||||
|
|
5
cli/tests/testdata/run/tls_starttls.js
vendored
5
cli/tests/testdata/run/tls_starttls.js
vendored
|
@ -1,5 +1,8 @@
|
|||
import { deferred } from "../../../../test_util/std/async/deferred.ts";
|
||||
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { BufReader } from "../../../../test_util/std/io/buf_reader.ts";
|
||||
import { BufWriter } from "../../../../test_util/std/io/buf_writer.ts";
|
||||
import { TextProtoReader } from "./textproto.ts";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { deferred } from "../../../../test_util/std/async/deferred.ts";
|
||||
|
||||
const errorDeferred = deferred();
|
||||
|
|
2
cli/tests/testdata/run/websocket_test.ts
vendored
2
cli/tests/testdata/run/websocket_test.ts
vendored
|
@ -4,7 +4,7 @@ import {
|
|||
assertEquals,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { deferred } from "../../../../test_util/std/async/deferred.ts";
|
||||
|
||||
Deno.test("invalid scheme", () => {
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
assertRejects,
|
||||
assertThrows,
|
||||
unreachable,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test("fragment", () => {
|
||||
assertThrows(() => new WebSocketStream("ws://localhost:4242/#"));
|
||||
|
|
2
cli/tests/testdata/test/allow_all.ts
vendored
2
cli/tests/testdata/test/allow_all.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const permissions: Deno.PermissionName[] = [
|
||||
"read",
|
||||
|
|
2
cli/tests/testdata/test/allow_none.ts
vendored
2
cli/tests/testdata/test/allow_none.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
import { unreachable } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { unreachable } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const permissions: Deno.PermissionName[] = [
|
||||
"read",
|
||||
|
|
2
cli/tests/testdata/workers/deno_worker.ts
vendored
2
cli/tests/testdata/workers/deno_worker.ts
vendored
|
@ -1,4 +1,4 @@
|
|||
import { assert } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assert } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
onmessage = function (e) {
|
||||
if (typeof self.Deno === "undefined") {
|
||||
|
|
2
cli/tests/testdata/workers/test.ts
vendored
2
cli/tests/testdata/workers/test.ts
vendored
|
@ -7,7 +7,7 @@ import {
|
|||
assertEquals,
|
||||
assertMatch,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { deferred } from "../../../../test_util/std/async/deferred.ts";
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../test_util/std/testing/asserts.ts";
|
||||
import { deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
|
||||
Deno.test("BroadcastChannel worker", async () => {
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
// NOTE: these are just sometests to test the TypeScript types. Real coverage is
|
||||
// provided by WPT.
|
||||
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
|
||||
Deno.test("messagechannel", async () => {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../test_util/std/testing/asserts.ts";
|
||||
import { assert, assertStringIncludes, unreachable } from "./test_util.ts";
|
||||
|
||||
Deno.test(async function sendAsyncStackTrace() {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import {
|
||||
assertMatch,
|
||||
assertRejects,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { Buffer, BufReader, BufWriter } from "../../../test_util/std/io/mod.ts";
|
||||
import { TextProtoReader } from "../testdata/run/textproto.ts";
|
||||
import {
|
||||
|
|
|
@ -18,7 +18,7 @@ export {
|
|||
fail,
|
||||
unimplemented,
|
||||
unreachable,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
export { deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
export type { Deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
export { delay } from "../../../test_util/std/async/delay.ts";
|
||||
|
|
|
@ -3,7 +3,7 @@ import * as fs from "node:fs";
|
|||
import {
|
||||
assertRejects,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test(
|
||||
"[node/fs.access] Uses the owner permission when the user is the owner",
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assertEquals,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { appendFile, appendFileSync } from "node:fs";
|
||||
import { fromFileUrl } from "../../../../test_util/std/path/mod.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
assertRejects,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { chmod, chmodSync } from "node:fs";
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { chown, chownSync } from "node:fs";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assert,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { close, closeSync } from "node:fs";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||
import { assert } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assert } from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { copyFile, copyFileSync, existsSync } from "node:fs";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assert,
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { Dir as DirOrig, type Dirent } from "node:fs";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assert,
|
||||
assertEquals,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { Dirent as Dirent_ } from "node:fs";
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assert,
|
||||
assertEquals,
|
||||
assertStringIncludes,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { exists, existsSync } from "node:fs";
|
||||
import { promisify } from "node:util";
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { fdatasync, fdatasyncSync } from "node:fs";
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { fstat, fstatSync } from "node:fs";
|
||||
import { fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { fail } from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts";
|
||||
import type { BigIntStats, Stats } from "node:fs";
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { fsync, fsyncSync } from "node:fs";
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assertEquals,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { ftruncate, ftruncateSync } from "node:fs";
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assertEquals,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { futimes, futimesSync } from "node:fs";
|
||||
|
||||
const randomDate = new Date(Date.now() + 1000);
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||
import { Buffer } from "node:buffer";
|
||||
import * as fs from "node:fs/promises";
|
||||
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
|
||||
const testData = path.resolve(moduleDir, "testdata", "hello.txt");
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
assert,
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { link, linkSync } from "node:fs";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { lstat, lstatSync } from "node:fs";
|
||||
import { fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { fail } from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts";
|
||||
import type { BigIntStats, Stats } from "node:fs";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||
import { assert } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assert } from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { existsSync, mkdir, mkdirSync } from "node:fs";
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assert,
|
||||
assertRejects,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { EncodingOption, existsSync, mkdtemp, mkdtempSync } from "node:fs";
|
||||
import { env } from "node:process";
|
||||
import { promisify } from "node:util";
|
||||
|
|
|
@ -14,7 +14,7 @@ import {
|
|||
assertEquals,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { open, openSync } from "node:fs";
|
||||
import { join, parse } from "node:path";
|
||||
|
|
|
@ -6,7 +6,7 @@ import {
|
|||
assertFalse,
|
||||
assertInstanceOf,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { opendir, opendirSync } from "node:fs";
|
||||
import { Buffer } from "node:buffer";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { readFile, readFileSync } from "node:fs";
|
||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
|
||||
const testData = path.resolve(moduleDir, "testdata", "hello.txt");
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
assertFalse,
|
||||
assertMatch,
|
||||
assertStrictEquals,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { read, readSync } from "node:fs";
|
||||
import { open, openSync } from "node:fs";
|
||||
import { Buffer } from "node:buffer";
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assertEquals,
|
||||
assertNotEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { readdir, readdirSync } from "node:fs";
|
||||
import { join } from "../../../../test_util/std/path/mod.ts";
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { readlink, readlinkSync } from "node:fs";
|
||||
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||
|
||||
const testDir = Deno.makeTempDirSync();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { realpath, realpathSync } from "node:fs";
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { rename, renameSync } from "node:fs";
|
||||
import { existsSync } from "node:fs";
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
assertRejects,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { rm, rmSync } from "node:fs";
|
||||
import { closeSync, existsSync } from "node:fs";
|
||||
import { join } from "../../../../test_util/std/path/mod.ts";
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { rmdir, rmdirSync } from "node:fs";
|
||||
import { closeSync } from "node:fs";
|
||||
import { existsSync } from "node:fs";
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { BigIntStats, stat, Stats, statSync } from "node:fs";
|
||||
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
export function assertStats(actual: Stats, expected: Deno.FileInfo) {
|
||||
assertEquals(actual.dev, expected.dev);
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assert,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { symlink, symlinkSync } from "node:fs";
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assertEquals,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { truncate, truncateSync } from "node:fs";
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { existsSync } from "node:fs";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { unlink, unlinkSync } from "node:fs";
|
||||
|
|
|
@ -3,7 +3,7 @@ import {
|
|||
assertEquals,
|
||||
assertThrows,
|
||||
fail,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { utimes, utimesSync } from "node:fs";
|
||||
|
||||
const randomDate = new Date(Date.now() + 1000);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { watch } from "node:fs";
|
||||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
function wait(time: number) {
|
||||
return new Promise((resolve) => {
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
assertNotEquals,
|
||||
assertRejects,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { writeFile, writeFileSync } from "node:fs";
|
||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { write, writeSync } from "node:fs";
|
||||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { Buffer } from "node:buffer";
|
||||
|
||||
const decoder = new TextDecoder("utf-8");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import {
|
||||
assert,
|
||||
assertStringIncludes,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
/** Asserts that an error thrown in a callback will not be wrongly caught. */
|
||||
export async function assertCallbackErrorUncaught(
|
||||
|
|
|
@ -3,7 +3,7 @@ import { stripColor } from "../../../test_util/std/fmt/colors.ts";
|
|||
import {
|
||||
assert,
|
||||
assertStrictEquals,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { AssertionError } from "node:assert";
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
||||
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
|
||||
Deno.test(async function foo() {
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Buffer } from "node:buffer";
|
|||
import {
|
||||
assertEquals,
|
||||
assertThrows,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test({
|
||||
name: "[node/buffer] alloc fails if size is not a number",
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
assertNotStrictEquals,
|
||||
assertStrictEquals,
|
||||
assertStringIncludes,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { Deferred, deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
import * as path from "../../../test_util/std/path/mod.ts";
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import crypto from "node:crypto";
|
|||
import { Buffer } from "node:buffer";
|
||||
import testVectors128 from "./gcmEncryptExtIV128.json" assert { type: "json" };
|
||||
import testVectors256 from "./gcmEncryptExtIV256.json" assert { type: "json" };
|
||||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const aesGcm = (bits: string, key: Uint8Array) => {
|
||||
const ALGO = bits == "128" ? `aes-128-gcm` : `aes-256-gcm`;
|
||||
|
|
|
@ -6,7 +6,7 @@ import { buffer, text } from "node:stream/consumers";
|
|||
import {
|
||||
assertEquals,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const rsaPrivateKey = Deno.readTextFileSync(
|
||||
new URL("../testdata/rsa_private.pem", import.meta.url),
|
||||
|
|
|
@ -8,7 +8,10 @@ import {
|
|||
} from "node:crypto";
|
||||
import { Buffer } from "node:buffer";
|
||||
import { Readable } from "node:stream";
|
||||
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
// https://github.com/denoland/deno/issues/18140
|
||||
Deno.test({
|
||||
|
|
|
@ -13,7 +13,7 @@ import { Buffer } from "node:buffer";
|
|||
import {
|
||||
assertEquals,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { createHmac } from "node:crypto";
|
||||
|
||||
const generateKeyPairAsync = promisify(
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { createSign, createVerify, sign, verify } from "node:crypto";
|
||||
import { Buffer } from "node:buffer";
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { assert, assertThrows } from "../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertThrows,
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { join } from "node:path";
|
||||
import { tmpdir } from "node:os";
|
||||
import { mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
import * as http2 from "node:http2";
|
||||
import * as net from "node:net";
|
||||
import { deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
import { assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
for (const url of ["http://127.0.0.1:4246", "https://127.0.0.1:4247"]) {
|
||||
Deno.test(`[node/http2 client] ${url}`, {
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
assert,
|
||||
assertEquals,
|
||||
fail,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { assertSpyCalls, spy } from "../../../test_util/std/testing/mock.ts";
|
||||
import { deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import {
|
|||
assertEquals,
|
||||
assertRejects,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||
import { randomBytes } from "node:crypto";
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ import {
|
|||
assertEquals,
|
||||
assertNotEquals,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { deferred } from "../../../../test_util/std/async/deferred.ts";
|
||||
|
||||
const validateNonZero = (buf: Buffer) => {
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { randomInt } from "node:crypto";
|
||||
import { assert, assertThrows } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertThrows,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
const between = (x: number, min: number, max: number) => x >= min && x < max;
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { pbkdf2, pbkdf2Sync } from "node:crypto";
|
||||
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
type Algorithms =
|
||||
| "md5"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { scrypt, scryptSync } from "node:crypto";
|
||||
import { Buffer } from "node:buffer";
|
||||
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
||||
import { deferred } from "../../../../test_util/std/async/deferred.ts";
|
||||
|
||||
Deno.test("scrypt works correctly", async () => {
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { createRequire, Module } from "node:module";
|
||||
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import process from "node:process";
|
||||
import * as path from "node:path";
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import * as net from "node:net";
|
||||
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import {
|
||||
assert,
|
||||
assertEquals,
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { Deferred, deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
import * as path from "../../../test_util/std/path/mod.ts";
|
||||
import * as http from "node:http";
|
||||
|
|
|
@ -7,7 +7,7 @@ import {
|
|||
assertEquals,
|
||||
assertNotEquals,
|
||||
assertThrows,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test({
|
||||
name: "build architecture is a string",
|
||||
|
|
|
@ -4,7 +4,7 @@ import path from "node:path";
|
|||
import posix from "node:path/posix";
|
||||
import win32 from "node:path/win32";
|
||||
|
||||
import { assertStrictEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assertStrictEquals } from "../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test("[node/path] posix and win32 objects", () => {
|
||||
assertStrictEquals(path.posix, posix);
|
||||
|
|
|
@ -4,7 +4,7 @@ import { performance } from "node:perf_hooks";
|
|||
import {
|
||||
assertEquals,
|
||||
assertThrows,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test({
|
||||
name: "[perf_hooks] performance",
|
||||
|
|
|
@ -11,7 +11,7 @@ import {
|
|||
assertObjectMatch,
|
||||
assertStrictEquals,
|
||||
assertThrows,
|
||||
} from "../../../test_util/std/assert/mod.ts";
|
||||
} from "../../../test_util/std/testing/asserts.ts";
|
||||
import { stripColor } from "../../../test_util/std/fmt/colors.ts";
|
||||
import { deferred } from "../../../test_util/std/async/deferred.ts";
|
||||
import * as path from "../../../test_util/std/path/mod.ts";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../test_util/std/testing/asserts.ts";
|
||||
import { parse, stringify } from "node:querystring";
|
||||
|
||||
Deno.test({
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { createInterface, Interface } from "node:readline";
|
||||
import { assertInstanceOf } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assertInstanceOf } from "../../../test_util/std/testing/asserts.ts";
|
||||
import { Readable, Writable } from "node:stream";
|
||||
|
||||
Deno.test("[node/readline] createInstance", () => {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import repl from "node:repl";
|
||||
import { assert } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assert } from "../../../test_util/std/testing/asserts.ts";
|
||||
|
||||
Deno.test({
|
||||
name: "repl module exports",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { assert } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assert } from "../../../test_util/std/testing/asserts.ts";
|
||||
import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts";
|
||||
import { pipeline } from "node:stream/promises";
|
||||
import { createReadStream, createWriteStream } from "node:fs";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
import { assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assertEquals } from "../../../test_util/std/testing/asserts.ts";
|
||||
import { Buffer } from "node:buffer";
|
||||
import { StringDecoder } from "node:string_decoder";
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||
|
||||
import { assert, fail } from "../../../test_util/std/assert/mod.ts";
|
||||
import { assert, fail } from "../../../test_util/std/testing/asserts.ts";
|
||||
import * as timers from "node:timers";
|
||||
import * as timersPromises from "node:timers/promises";
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue