Skip to content

Commit

Permalink
chore: update deno_std submodule (#20994)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored Oct 27, 2023
1 parent 9a97edc commit 6e2abb2
Show file tree
Hide file tree
Showing 110 changed files with 139 additions and 207 deletions.
3 changes: 2 additions & 1 deletion cli/tests/integration/compile_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ fn compile_basic() {
for _ in 0..2 {
let output = context
.new_command()
.cwd(util::testdata_path())
.args_vec([
"compile",
"--output",
&exe.to_string_lossy(),
"../../../test_util/std/examples/welcome.ts",
"./compile/welcome.ts",
])
.run();
output.assert_exit_code(0);
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/node_compat/common.ts
Original file line number Diff line number Diff line change
@@ -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/encoding/jsonc.ts";
import * as JSONC from "../../../test_util/std/jsonc/mod.ts";
/**
* The test suite matches the folders inside the `test` folder inside the
* node repo
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/node_compat/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/testing/asserts.ts";
import { fail } from "../../../test_util/std/assert/mod.ts";
import {
config,
getPathsFromTestSuites,
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/bench/allow_all.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";

const permissions: Deno.PermissionName[] = [
"read",
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/bench/allow_none.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { unreachable } from "../../../../test_util/std/testing/asserts.ts";
import { unreachable } from "../../../../test_util/std/assert/mod.ts";

const permissions: Deno.PermissionName[] = [
"read",
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/cert/listen_tls_alpn_fail.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertRejects } from "../../../../test_util/std/testing/asserts.ts";
import { assertRejects } from "../../../../test_util/std/assert/mod.ts";

const listener = Deno.listenTls({
port: Number(Deno.args[0]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
import {
assertNotEquals as _a,
assertStrictEquals as _b,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
1 change: 1 addition & 0 deletions cli/tests/testdata/compile/welcome.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("Welcome to Deno!");
2 changes: 1 addition & 1 deletion cli/tests/testdata/coverage/no_tests_included/foo.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { addNumbers } from "./foo.ts";
import { assertEquals } from "../../../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../../../test_util/std/assert/mod.ts";

Deno.test("addNumbers works", () => {
assertEquals(addNumbers(1, 2), 3);
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/coverage/no_tests_included/foo.test.mts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { addNumbers } from "./foo.ts";
import { assertEquals } from "../../../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../../../test_util/std/assert/mod.ts";

Deno.test("addNumbers works", () => {
assertEquals(addNumbers(1, 2), 3);
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/coverage/no_tests_included/foo.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { addNumbers } from "./foo.ts";
import { assertEquals } from "../../../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../../../test_util/std/assert/mod.ts";

Deno.test("addNumbers works", () => {
assertEquals(addNumbers(1, 2), 3);
Expand Down
6 changes: 2 additions & 4 deletions cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ FNH:0
BRF:0
BRH:0
DA:1,1
DA:2,1
DA:3,1
DA:5,1
LH:4
LF:4
LH:2
LF:2
end_of_record
Original file line number Diff line number Diff line change
@@ -1 +1 @@
cover [WILDCARD]index.ts ... 100.000% (4/4)
cover [WILDCARD]index.ts ... 100.000% (2/2)
4 changes: 1 addition & 3 deletions cli/tests/testdata/coverage/no_transpiled_lines/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export {
assertStrictEquals,
} from "../../../../../test_util/std/testing/asserts.ts";
export { assertStrictEquals } from "../../../../../test_util/std/assert/mod.ts";

export * from "./interface.ts";
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/045_proxy_test.ts
Original file line number Diff line number Diff line change
@@ -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/testing/asserts.ts";
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";

const addr = Deno.args[1] || "localhost:4555";

Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/import_meta/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertThrows } from "../../../../../test_util/std/testing/asserts.ts";
import { assertThrows } from "../../../../../test_util/std/assert/mod.ts";

console.log("main", import.meta.url, import.meta.main);

Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/onload/imported.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// deno-lint-ignore-file no-window-prefix
import { assert } from "../../../../../test_util/std/testing/asserts.ts";
import { assert } from "../../../../../test_util/std/assert/mod.ts";
import "./nest_imported.ts";

const handler = (e: Event) => {
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/onload/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// deno-lint-ignore-file no-window-prefix no-prototype-builtins
import { assert } from "../../../../../test_util/std/testing/asserts.ts";
import { assert } from "../../../../../test_util/std/assert/mod.ts";
import "./imported.ts";

assert(window.hasOwnProperty("onload"));
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/onload/nest_imported.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// deno-lint-ignore-file no-window-prefix
import { assert } from "../../../../../test_util/std/testing/asserts.ts";
import { assert } from "../../../../../test_util/std/assert/mod.ts";

const handler = (e: Event) => {
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
Expand Down
5 changes: 1 addition & 4 deletions cli/tests/testdata/run/tls_connecttls.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { deferred } from "../../../../test_util/std/async/deferred.ts";
import {
assert,
assertEquals,
} from "../../../../test_util/std/testing/asserts.ts";
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
import { BufReader, BufWriter } from "../../../../test_util/std/io/mod.ts";
import { TextProtoReader } from "./textproto.ts";

Expand Down
5 changes: 1 addition & 4 deletions cli/tests/testdata/run/tls_starttls.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { deferred } from "../../../../test_util/std/async/deferred.ts";
import {
assert,
assertEquals,
} from "../../../../test_util/std/testing/asserts.ts";
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.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";
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/websocket_server_idletimeout.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
import { deferred } from "../../../../test_util/std/async/deferred.ts";

const errorDeferred = deferred();
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/websocket_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
assertEquals,
assertThrows,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { deferred } from "../../../../test_util/std/async/deferred.ts";

Deno.test("invalid scheme", () => {
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/websocketstream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
assertRejects,
assertThrows,
unreachable,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";

Deno.test("fragment", () => {
assertThrows(() => new WebSocketStream("ws://localhost:4242/#"));
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/test/allow_all.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";

const permissions: Deno.PermissionName[] = [
"read",
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/test/allow_none.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { unreachable } from "../../../../test_util/std/testing/asserts.ts";
import { unreachable } from "../../../../test_util/std/assert/mod.ts";

const permissions: Deno.PermissionName[] = [
"read",
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/workers/deno_worker.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assert } from "../../../../test_util/std/testing/asserts.ts";
import { assert } from "../../../../test_util/std/assert/mod.ts";

onmessage = function (e) {
if (typeof self.Deno === "undefined") {
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/workers/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
assertEquals,
assertMatch,
assertThrows,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { deferred } from "../../../../test_util/std/async/deferred.ts";

Deno.test({
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit/broadcast_channel_test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../test_util/std/assert/mod.ts";
import { deferred } from "../../../test_util/std/async/deferred.ts";

Deno.test("BroadcastChannel worker", async () => {
Expand Down
5 changes: 1 addition & 4 deletions cli/tests/unit/message_channel_test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// 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/testing/asserts.ts";
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
import { deferred } from "../../../test_util/std/async/deferred.ts";

Deno.test("messagechannel", async () => {
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit/opcall_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

import { assertEquals } from "../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../test_util/std/assert/mod.ts";
import { assert, assertStringIncludes, unreachable } from "./test_util.ts";

Deno.test(async function sendAsyncStackTrace() {
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit/serve_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import {
assertMatch,
assertRejects,
} from "../../../test_util/std/testing/asserts.ts";
} from "../../../test_util/std/assert/mod.ts";
import { Buffer, BufReader, BufWriter } from "../../../test_util/std/io/mod.ts";
import { TextProtoReader } from "../testdata/run/textproto.ts";
import {
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit/test_util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export {
fail,
unimplemented,
unreachable,
} from "../../../test_util/std/testing/asserts.ts";
} from "../../../test_util/std/assert/mod.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";
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_access_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fs from "node:fs";
import {
assertRejects,
assertThrows,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";

Deno.test(
"[node/fs.access] Uses the owner permission when the user is the owner",
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_appendFile_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assertEquals,
assertThrows,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { appendFile, appendFileSync } from "node:fs";
import { fromFileUrl } from "../../../../test_util/std/path/mod.ts";
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_chmod_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
assertRejects,
assertThrows,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { chmod, chmodSync } from "node:fs";

Expand Down
5 changes: 1 addition & 4 deletions cli/tests/unit_node/_fs/_fs_chown_test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import {
assertEquals,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { chown, chownSync } from "node:fs";

Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_close_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assert,
assertThrows,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { close, closeSync } from "node:fs";

Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_copy_test.ts
Original file line number Diff line number Diff line change
@@ -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/testing/asserts.ts";
import { assert } from "../../../../test_util/std/assert/mod.ts";
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { copyFile, copyFileSync, existsSync } from "node:fs";

Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_dir_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assert,
assertEquals,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { Dir as DirOrig, type Dirent } from "node:fs";

Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_dirent_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assert,
assertEquals,
assertThrows,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { Dirent as Dirent_ } from "node:fs";

// deno-lint-ignore no-explicit-any
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_exists_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assert,
assertEquals,
assertStringIncludes,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { exists, existsSync } from "node:fs";
import { promisify } from "node:util";

Expand Down
5 changes: 1 addition & 4 deletions cli/tests/unit_node/_fs/_fs_fdatasync_test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import {
assertEquals,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
import { fdatasync, fdatasyncSync } from "node:fs";

Deno.test({
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_fstat_test.ts
Original file line number Diff line number Diff line change
@@ -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/testing/asserts.ts";
import { fail } from "../../../../test_util/std/assert/mod.ts";
import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts";
import type { BigIntStats, Stats } from "node:fs";

Expand Down
5 changes: 1 addition & 4 deletions cli/tests/unit_node/_fs/_fs_fsync_test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import {
assertEquals,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
import { fsync, fsyncSync } from "node:fs";

Deno.test({
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_ftruncate_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assertEquals,
assertThrows,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { ftruncate, ftruncateSync } from "node:fs";

Deno.test({
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_futimes_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
assertEquals,
assertThrows,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { futimes, futimesSync } from "node:fs";

const randomDate = new Date(Date.now() + 1000);
Expand Down
5 changes: 1 addition & 4 deletions cli/tests/unit_node/_fs/_fs_handle_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
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/testing/asserts.ts";
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";

const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
const testData = path.resolve(moduleDir, "testdata", "hello.txt");
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/unit_node/_fs/_fs_link_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
assert,
assertEquals,
fail,
} from "../../../../test_util/std/testing/asserts.ts";
} from "../../../../test_util/std/assert/mod.ts";
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
import { link, linkSync } from "node:fs";

Expand Down
Loading

0 comments on commit 6e2abb2

Please sign in to comment.