From 33565e16ca0f9d2d04e2c43b7f6949106ba8cf18 Mon Sep 17 00:00:00 2001 From: Jared Flatow Date: Fri, 27 Oct 2023 04:34:41 -0700 Subject: [PATCH 01/10] fix(ext/http): patch regression in variadic args to serve handler (#20796) I'm not sure what was the purpose of trying to be so clever with the args were (maybe an optimization?), but it breaks variadic args as pointed out in #20054. Signed-off-by: Matt Mastracci Co-authored-by: Matt Mastracci --- ext/http/00_serve.js | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/ext/http/00_serve.js b/ext/http/00_serve.js index 2e0c62fefa940a..17a67814bbecf3 100644 --- a/ext/http/00_serve.js +++ b/ext/http/00_serve.js @@ -435,8 +435,6 @@ function fastSyncResponseOrStream(req, respBody, status) { */ function mapToCallback(context, callback, onError) { const signal = context.abortController.signal; - const hasCallback = callback.length > 0; - const hasOneCallback = callback.length === 1; return async function (req) { // Get the response from the user-provided callback. If that fails, use onError. If that fails, return a fallback @@ -444,20 +442,11 @@ function mapToCallback(context, callback, onError) { let innerRequest; let response; try { - if (hasCallback) { - innerRequest = new InnerRequest(req, context); - const request = fromInnerRequest(innerRequest, signal, "immutable"); - if (hasOneCallback) { - response = await callback(request); - } else { - response = await callback( - request, - new ServeHandlerInfo(innerRequest), - ); - } - } else { - response = await callback(); - } + innerRequest = new InnerRequest(req, context); + response = await callback( + fromInnerRequest(innerRequest, signal, "immutable"), + new ServeHandlerInfo(innerRequest), + ); } catch (error) { try { response = await onError(error); From 9a97edce05ba3719ae3ace41df2b49e9168c1fa9 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Fri, 27 Oct 2023 14:35:31 +0200 Subject: [PATCH 02/10] feat: rename Deno.Server to Deno.HttpServer (#20842) Keeps the old name around for backwards compat. Closes #20840 --- cli/tsc/dts/lib.deno.ns.d.ts | 14 ++++++++++---- cli/tsc/dts/lib.deno.unstable.d.ts | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 6784ee0529b884..e51e9736a9e5c7 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -5911,7 +5911,7 @@ declare namespace Deno { * * @category HTTP Server */ - export interface Server { + export interface HttpServer { /** A promise that resolves once server finishes - eg. when aborted using * the signal passed to {@linkcode ServeOptions.signal}. */ @@ -5929,6 +5929,12 @@ declare namespace Deno { unref(): void; } + /** + * @category HTTP Server + * @deprecated Use {@linkcode HttpServer} instead. + */ + export type Server = HttpServer; + /** Serves HTTP requests with the given handler. * * The below example serves with the port `8000` on hostname `"127.0.0.1"`. @@ -5939,7 +5945,7 @@ declare namespace Deno { * * @category HTTP Server */ - export function serve(handler: ServeHandler): Server; + export function serve(handler: ServeHandler): HttpServer; /** Serves HTTP requests with the given option bag and handler. * * You can specify an object with a port and hostname option, which is the @@ -5999,7 +6005,7 @@ declare namespace Deno { export function serve( options: ServeOptions | ServeTlsOptions, handler: ServeHandler, - ): Server; + ): HttpServer; /** Serves HTTP requests with the given option bag. * * You can specify an object with a port and hostname option, which is the @@ -6027,5 +6033,5 @@ declare namespace Deno { */ export function serve( options: ServeInit & (ServeOptions | ServeTlsOptions), - ): Server; + ): HttpServer; } diff --git a/cli/tsc/dts/lib.deno.unstable.d.ts b/cli/tsc/dts/lib.deno.unstable.d.ts index 76e8ef49bc1326..56188f3b8ab592 100644 --- a/cli/tsc/dts/lib.deno.unstable.d.ts +++ b/cli/tsc/dts/lib.deno.unstable.d.ts @@ -1941,7 +1941,7 @@ declare namespace Deno { * * @category HTTP Server */ - export interface Server { + export interface HttpServer { /** Gracefully close the server. No more new connections will be accepted, * while pending requests will be allowed to finish. */ From 6e2abb2b13af5dff5d631fb1bc0c279c49ebd066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 27 Oct 2023 16:34:30 +0200 Subject: [PATCH 03/10] chore: update deno_std submodule (#20994) --- cli/tests/integration/compile_tests.rs | 3 +- cli/tests/node_compat/common.ts | 2 +- cli/tests/node_compat/test.ts | 2 +- cli/tests/testdata/bench/allow_all.ts | 2 +- cli/tests/testdata/bench/allow_none.ts | 2 +- .../testdata/cert/listen_tls_alpn_fail.ts | 2 +- .../compile/standalone_follow_redirects_2.js | 2 +- cli/tests/testdata/compile/welcome.ts | 1 + .../coverage/no_tests_included/foo.test.js | 2 +- .../coverage/no_tests_included/foo.test.mts | 2 +- .../coverage/no_tests_included/foo.test.ts | 2 +- .../no_transpiled_lines/expected.lcov | 6 +- .../coverage/no_transpiled_lines/expected.out | 2 +- .../coverage/no_transpiled_lines/index.ts | 4 +- cli/tests/testdata/run/045_proxy_test.ts | 2 +- cli/tests/testdata/run/import_meta/main.ts | 2 +- cli/tests/testdata/run/onload/imported.ts | 2 +- cli/tests/testdata/run/onload/main.ts | 2 +- .../testdata/run/onload/nest_imported.ts | 2 +- cli/tests/testdata/run/tls_connecttls.js | 5 +- cli/tests/testdata/run/tls_starttls.js | 5 +- .../run/websocket_server_idletimeout.ts | 2 +- cli/tests/testdata/run/websocket_test.ts | 2 +- .../testdata/run/websocketstream_test.ts | 2 +- cli/tests/testdata/test/allow_all.ts | 2 +- cli/tests/testdata/test/allow_none.ts | 2 +- cli/tests/testdata/workers/deno_worker.ts | 2 +- cli/tests/testdata/workers/test.ts | 2 +- cli/tests/unit/broadcast_channel_test.ts | 2 +- cli/tests/unit/message_channel_test.ts | 5 +- cli/tests/unit/opcall_test.ts | 2 +- cli/tests/unit/serve_test.ts | 2 +- cli/tests/unit/test_util.ts | 2 +- cli/tests/unit_node/_fs/_fs_access_test.ts | 2 +- .../unit_node/_fs/_fs_appendFile_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_chmod_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_chown_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_close_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_copy_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_dir_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_dirent_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_exists_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_fdatasync_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_fstat_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_fsync_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_ftruncate_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_futimes_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_handle_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_link_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_lstat_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_mkdir_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_open_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_opendir_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_readFile_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_read_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_readdir_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_readlink_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_realpath_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_rename_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_rm_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_rmdir_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_stat_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_symlink_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_truncate_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_unlink_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_utimes_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_watch_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_writeFile_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_write_test.ts | 2 +- cli/tests/unit_node/_test_utils.ts | 2 +- cli/tests/unit_node/assertion_error_test.ts | 2 +- cli/tests/unit_node/async_hooks_test.ts | 5 +- cli/tests/unit_node/buffer_test.ts | 2 +- cli/tests/unit_node/child_process_test.ts | 2 +- .../crypto/crypto_cipher_gcm_test.ts | 2 +- .../unit_node/crypto/crypto_cipher_test.ts | 2 +- .../unit_node/crypto/crypto_hash_test.ts | 5 +- cli/tests/unit_node/crypto/crypto_key_test.ts | 2 +- .../unit_node/crypto/crypto_sign_test.ts | 5 +- cli/tests/unit_node/fs_test.ts | 5 +- cli/tests/unit_node/http2_test.ts | 2 +- cli/tests/unit_node/http_test.ts | 2 +- .../unit_node/internal/_randomBytes_test.ts | 2 +- .../unit_node/internal/_randomFill_test.ts | 2 +- .../unit_node/internal/_randomInt_test.ts | 5 +- cli/tests/unit_node/internal/pbkdf2_test.ts | 5 +- cli/tests/unit_node/internal/scrypt_test.ts | 2 +- cli/tests/unit_node/module_test.ts | 5 +- cli/tests/unit_node/net_test.ts | 5 +- cli/tests/unit_node/os_test.ts | 2 +- cli/tests/unit_node/path_test.ts | 2 +- cli/tests/unit_node/perf_hooks_test.ts | 2 +- cli/tests/unit_node/process_test.ts | 2 +- cli/tests/unit_node/querystring_test.ts | 2 +- cli/tests/unit_node/readline_test.ts | 2 +- cli/tests/unit_node/repl_test.ts | 2 +- cli/tests/unit_node/stream_test.ts | 2 +- cli/tests/unit_node/string_decoder_test.ts | 2 +- cli/tests/unit_node/timers_test.ts | 2 +- cli/tests/unit_node/tls_test.ts | 2 +- cli/tests/unit_node/tty_test.ts | 2 +- cli/tests/unit_node/util_test.ts | 2 +- cli/tests/unit_node/v8_test.ts | 2 +- cli/tests/unit_node/worker_threads_test.ts | 2 +- cli/tests/unit_node/zlib_test.ts | 5 +- cli/tsc/dts/lib.deno.ns.d.ts | 56 +++++++++---------- test_ffi/tests/test.js | 2 +- test_napi/common.js | 2 +- test_util/std | 2 +- 110 files changed, 139 insertions(+), 207 deletions(-) create mode 100644 cli/tests/testdata/compile/welcome.ts diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs index 3ca57a35f44f8e..4835bacc8afeeb 100644 --- a/cli/tests/integration/compile_tests.rs +++ b/cli/tests/integration/compile_tests.rs @@ -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); diff --git a/cli/tests/node_compat/common.ts b/cli/tests/node_compat/common.ts index 1b9748f26f60ed..7de7026cd4e8e7 100644 --- a/cli/tests/node_compat/common.ts +++ b/cli/tests/node_compat/common.ts @@ -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 diff --git a/cli/tests/node_compat/test.ts b/cli/tests/node_compat/test.ts index 52bb6810c1dabe..acd45ffe62242c 100644 --- a/cli/tests/node_compat/test.ts +++ b/cli/tests/node_compat/test.ts @@ -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, diff --git a/cli/tests/testdata/bench/allow_all.ts b/cli/tests/testdata/bench/allow_all.ts index d7dde3a855abbb..beb4a450e5ed6f 100644 --- a/cli/tests/testdata/bench/allow_all.ts +++ b/cli/tests/testdata/bench/allow_all.ts @@ -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", diff --git a/cli/tests/testdata/bench/allow_none.ts b/cli/tests/testdata/bench/allow_none.ts index 778e98420a6923..e723ed8684aed5 100644 --- a/cli/tests/testdata/bench/allow_none.ts +++ b/cli/tests/testdata/bench/allow_none.ts @@ -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", diff --git a/cli/tests/testdata/cert/listen_tls_alpn_fail.ts b/cli/tests/testdata/cert/listen_tls_alpn_fail.ts index da60383f0a0209..c1aa4b31d0f02e 100644 --- a/cli/tests/testdata/cert/listen_tls_alpn_fail.ts +++ b/cli/tests/testdata/cert/listen_tls_alpn_fail.ts @@ -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]), diff --git a/cli/tests/testdata/compile/standalone_follow_redirects_2.js b/cli/tests/testdata/compile/standalone_follow_redirects_2.js index a1bf83875809a2..00ebc0f5c9bae8 100644 --- a/cli/tests/testdata/compile/standalone_follow_redirects_2.js +++ b/cli/tests/testdata/compile/standalone_follow_redirects_2.js @@ -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"; diff --git a/cli/tests/testdata/compile/welcome.ts b/cli/tests/testdata/compile/welcome.ts new file mode 100644 index 00000000000000..f983ca89baec1b --- /dev/null +++ b/cli/tests/testdata/compile/welcome.ts @@ -0,0 +1 @@ +console.log("Welcome to Deno!"); diff --git a/cli/tests/testdata/coverage/no_tests_included/foo.test.js b/cli/tests/testdata/coverage/no_tests_included/foo.test.js index 12da76d02b6b86..f555c2d0a6b128 100644 --- a/cli/tests/testdata/coverage/no_tests_included/foo.test.js +++ b/cli/tests/testdata/coverage/no_tests_included/foo.test.js @@ -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); diff --git a/cli/tests/testdata/coverage/no_tests_included/foo.test.mts b/cli/tests/testdata/coverage/no_tests_included/foo.test.mts index 12da76d02b6b86..f555c2d0a6b128 100644 --- a/cli/tests/testdata/coverage/no_tests_included/foo.test.mts +++ b/cli/tests/testdata/coverage/no_tests_included/foo.test.mts @@ -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); diff --git a/cli/tests/testdata/coverage/no_tests_included/foo.test.ts b/cli/tests/testdata/coverage/no_tests_included/foo.test.ts index 12da76d02b6b86..f555c2d0a6b128 100644 --- a/cli/tests/testdata/coverage/no_tests_included/foo.test.ts +++ b/cli/tests/testdata/coverage/no_tests_included/foo.test.ts @@ -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); diff --git a/cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov b/cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov index fae96ed355d539..480945d142daad 100644 --- a/cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov +++ b/cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov @@ -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 diff --git a/cli/tests/testdata/coverage/no_transpiled_lines/expected.out b/cli/tests/testdata/coverage/no_transpiled_lines/expected.out index 792bd654f66104..3438a045c45dc8 100644 --- a/cli/tests/testdata/coverage/no_transpiled_lines/expected.out +++ b/cli/tests/testdata/coverage/no_transpiled_lines/expected.out @@ -1 +1 @@ -cover [WILDCARD]index.ts ... 100.000% (4/4) +cover [WILDCARD]index.ts ... 100.000% (2/2) diff --git a/cli/tests/testdata/coverage/no_transpiled_lines/index.ts b/cli/tests/testdata/coverage/no_transpiled_lines/index.ts index df25283cd3e989..7e4f22163570de 100644 --- a/cli/tests/testdata/coverage/no_transpiled_lines/index.ts +++ b/cli/tests/testdata/coverage/no_transpiled_lines/index.ts @@ -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"; diff --git a/cli/tests/testdata/run/045_proxy_test.ts b/cli/tests/testdata/run/045_proxy_test.ts index 8ca733a942cee1..eacce1130cffac 100644 --- a/cli/tests/testdata/run/045_proxy_test.ts +++ b/cli/tests/testdata/run/045_proxy_test.ts @@ -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"; diff --git a/cli/tests/testdata/run/import_meta/main.ts b/cli/tests/testdata/run/import_meta/main.ts index 0d7cb96daef64d..b6d9c506ecc46a 100644 --- a/cli/tests/testdata/run/import_meta/main.ts +++ b/cli/tests/testdata/run/import_meta/main.ts @@ -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); diff --git a/cli/tests/testdata/run/onload/imported.ts b/cli/tests/testdata/run/onload/imported.ts index f4157b86f8309f..971ddaea351676 100644 --- a/cli/tests/testdata/run/onload/imported.ts +++ b/cli/tests/testdata/run/onload/imported.ts @@ -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) => { diff --git a/cli/tests/testdata/run/onload/main.ts b/cli/tests/testdata/run/onload/main.ts index 126627e34faaa6..191c4d872879fd 100644 --- a/cli/tests/testdata/run/onload/main.ts +++ b/cli/tests/testdata/run/onload/main.ts @@ -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")); diff --git a/cli/tests/testdata/run/onload/nest_imported.ts b/cli/tests/testdata/run/onload/nest_imported.ts index a942d272954e2a..e8969985491273 100644 --- a/cli/tests/testdata/run/onload/nest_imported.ts +++ b/cli/tests/testdata/run/onload/nest_imported.ts @@ -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); diff --git a/cli/tests/testdata/run/tls_connecttls.js b/cli/tests/testdata/run/tls_connecttls.js index 7c03856cb7985d..1fcf6640a8310b 100644 --- a/cli/tests/testdata/run/tls_connecttls.js +++ b/cli/tests/testdata/run/tls_connecttls.js @@ -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"; diff --git a/cli/tests/testdata/run/tls_starttls.js b/cli/tests/testdata/run/tls_starttls.js index ecf344211be33e..34b97a4cbce5f5 100644 --- a/cli/tests/testdata/run/tls_starttls.js +++ b/cli/tests/testdata/run/tls_starttls.js @@ -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"; diff --git a/cli/tests/testdata/run/websocket_server_idletimeout.ts b/cli/tests/testdata/run/websocket_server_idletimeout.ts index 211b5f6ea9e44a..e7bfd733728bf3 100644 --- a/cli/tests/testdata/run/websocket_server_idletimeout.ts +++ b/cli/tests/testdata/run/websocket_server_idletimeout.ts @@ -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(); diff --git a/cli/tests/testdata/run/websocket_test.ts b/cli/tests/testdata/run/websocket_test.ts index d80f03c92aa126..924738abe28087 100644 --- a/cli/tests/testdata/run/websocket_test.ts +++ b/cli/tests/testdata/run/websocket_test.ts @@ -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", () => { diff --git a/cli/tests/testdata/run/websocketstream_test.ts b/cli/tests/testdata/run/websocketstream_test.ts index 82dd59a20e45e0..f34eaf0ab9b503 100644 --- a/cli/tests/testdata/run/websocketstream_test.ts +++ b/cli/tests/testdata/run/websocketstream_test.ts @@ -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/#")); diff --git a/cli/tests/testdata/test/allow_all.ts b/cli/tests/testdata/test/allow_all.ts index c7a2381300e8c8..50cd407e41a28b 100644 --- a/cli/tests/testdata/test/allow_all.ts +++ b/cli/tests/testdata/test/allow_all.ts @@ -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", diff --git a/cli/tests/testdata/test/allow_none.ts b/cli/tests/testdata/test/allow_none.ts index 3153b97553d707..eb760242a4ea71 100644 --- a/cli/tests/testdata/test/allow_none.ts +++ b/cli/tests/testdata/test/allow_none.ts @@ -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", diff --git a/cli/tests/testdata/workers/deno_worker.ts b/cli/tests/testdata/workers/deno_worker.ts index a4dca150686ac1..eccdab5b0b7de7 100644 --- a/cli/tests/testdata/workers/deno_worker.ts +++ b/cli/tests/testdata/workers/deno_worker.ts @@ -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") { diff --git a/cli/tests/testdata/workers/test.ts b/cli/tests/testdata/workers/test.ts index 0ea9a74772b72c..6892ed85aa46e7 100644 --- a/cli/tests/testdata/workers/test.ts +++ b/cli/tests/testdata/workers/test.ts @@ -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({ diff --git a/cli/tests/unit/broadcast_channel_test.ts b/cli/tests/unit/broadcast_channel_test.ts index b13a4757489817..f18934278719c3 100644 --- a/cli/tests/unit/broadcast_channel_test.ts +++ b/cli/tests/unit/broadcast_channel_test.ts @@ -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 () => { diff --git a/cli/tests/unit/message_channel_test.ts b/cli/tests/unit/message_channel_test.ts index 35b7c47c40700b..a3fc94c79a49ca 100644 --- a/cli/tests/unit/message_channel_test.ts +++ b/cli/tests/unit/message_channel_test.ts @@ -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 () => { diff --git a/cli/tests/unit/opcall_test.ts b/cli/tests/unit/opcall_test.ts index fb269fc3239359..d2c65440c7dca6 100644 --- a/cli/tests/unit/opcall_test.ts +++ b/cli/tests/unit/opcall_test.ts @@ -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() { diff --git a/cli/tests/unit/serve_test.ts b/cli/tests/unit/serve_test.ts index 2e560af9957f3b..49f8c1f2dad9d6 100644 --- a/cli/tests/unit/serve_test.ts +++ b/cli/tests/unit/serve_test.ts @@ -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 { diff --git a/cli/tests/unit/test_util.ts b/cli/tests/unit/test_util.ts index de1e8e8c5d1e5b..2061f859e86f03 100644 --- a/cli/tests/unit/test_util.ts +++ b/cli/tests/unit/test_util.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_access_test.ts b/cli/tests/unit_node/_fs/_fs_access_test.ts index 5fd2a5b31dcbb4..15fa2410f74f4b 100644 --- a/cli/tests/unit_node/_fs/_fs_access_test.ts +++ b/cli/tests/unit_node/_fs/_fs_access_test.ts @@ -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", diff --git a/cli/tests/unit_node/_fs/_fs_appendFile_test.ts b/cli/tests/unit_node/_fs/_fs_appendFile_test.ts index 5741938f0659c9..37701593459376 100644 --- a/cli/tests/unit_node/_fs/_fs_appendFile_test.ts +++ b/cli/tests/unit_node/_fs/_fs_appendFile_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_chmod_test.ts b/cli/tests/unit_node/_fs/_fs_chmod_test.ts index 11f01d1ad6e5dc..4704f612fd130e 100644 --- a/cli/tests/unit_node/_fs/_fs_chmod_test.ts +++ b/cli/tests/unit_node/_fs/_fs_chmod_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_chown_test.ts b/cli/tests/unit_node/_fs/_fs_chown_test.ts index 2174d49d718fa7..4fd2d6c8c8b472 100644 --- a/cli/tests/unit_node/_fs/_fs_chown_test.ts +++ b/cli/tests/unit_node/_fs/_fs_chown_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_close_test.ts b/cli/tests/unit_node/_fs/_fs_close_test.ts index 4d0743dbd7b19d..d14ad1b73cc344 100644 --- a/cli/tests/unit_node/_fs/_fs_close_test.ts +++ b/cli/tests/unit_node/_fs/_fs_close_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_copy_test.ts b/cli/tests/unit_node/_fs/_fs_copy_test.ts index b08e8d7f3d7dee..cea6e65ab7424f 100644 --- a/cli/tests/unit_node/_fs/_fs_copy_test.ts +++ b/cli/tests/unit_node/_fs/_fs_copy_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_dir_test.ts b/cli/tests/unit_node/_fs/_fs_dir_test.ts index 7f53ee1d36c641..eb8a0073b27011 100644 --- a/cli/tests/unit_node/_fs/_fs_dir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_dir_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_dirent_test.ts b/cli/tests/unit_node/_fs/_fs_dirent_test.ts index eca693f6fb6b5f..8a3f066ea254ca 100644 --- a/cli/tests/unit_node/_fs/_fs_dirent_test.ts +++ b/cli/tests/unit_node/_fs/_fs_dirent_test.ts @@ -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 diff --git a/cli/tests/unit_node/_fs/_fs_exists_test.ts b/cli/tests/unit_node/_fs/_fs_exists_test.ts index 9af5b32081d792..49dad173df0945 100644 --- a/cli/tests/unit_node/_fs/_fs_exists_test.ts +++ b/cli/tests/unit_node/_fs/_fs_exists_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts b/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts index d7ccae927fdee0..6253dffffa6d5c 100644 --- a/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts +++ b/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts @@ -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({ diff --git a/cli/tests/unit_node/_fs/_fs_fstat_test.ts b/cli/tests/unit_node/_fs/_fs_fstat_test.ts index 70c3db254ad4db..fe578aa5142802 100644 --- a/cli/tests/unit_node/_fs/_fs_fstat_test.ts +++ b/cli/tests/unit_node/_fs/_fs_fstat_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_fsync_test.ts b/cli/tests/unit_node/_fs/_fs_fsync_test.ts index 586c7d7e6cb3c2..0d055fdcebdffa 100644 --- a/cli/tests/unit_node/_fs/_fs_fsync_test.ts +++ b/cli/tests/unit_node/_fs/_fs_fsync_test.ts @@ -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({ diff --git a/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts b/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts index 46787bec133fe0..67bc8262e19548 100644 --- a/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts +++ b/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts @@ -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({ diff --git a/cli/tests/unit_node/_fs/_fs_futimes_test.ts b/cli/tests/unit_node/_fs/_fs_futimes_test.ts index c5b9012a53ff8f..3b76807ffbb316 100644 --- a/cli/tests/unit_node/_fs/_fs_futimes_test.ts +++ b/cli/tests/unit_node/_fs/_fs_futimes_test.ts @@ -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); diff --git a/cli/tests/unit_node/_fs/_fs_handle_test.ts b/cli/tests/unit_node/_fs/_fs_handle_test.ts index 8cfbf64906d072..2322068607470f 100644 --- a/cli/tests/unit_node/_fs/_fs_handle_test.ts +++ b/cli/tests/unit_node/_fs/_fs_handle_test.ts @@ -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"); diff --git a/cli/tests/unit_node/_fs/_fs_link_test.ts b/cli/tests/unit_node/_fs/_fs_link_test.ts index a96457eb06850e..3594b56fe1ac01 100644 --- a/cli/tests/unit_node/_fs/_fs_link_test.ts +++ b/cli/tests/unit_node/_fs/_fs_link_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_lstat_test.ts b/cli/tests/unit_node/_fs/_fs_lstat_test.ts index cd11279898e61b..c09f840eb2ae9c 100644 --- a/cli/tests/unit_node/_fs/_fs_lstat_test.ts +++ b/cli/tests/unit_node/_fs/_fs_lstat_test.ts @@ -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/testing/asserts.ts"; +import { fail } from "../../../../test_util/std/assert/mod.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts"; import type { BigIntStats, Stats } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_mkdir_test.ts b/cli/tests/unit_node/_fs/_fs_mkdir_test.ts index 0deae9276d8897..b55ffd4a45f212 100644 --- a/cli/tests/unit_node/_fs/_fs_mkdir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_mkdir_test.ts @@ -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 { existsSync, mkdir, mkdirSync } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts b/cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts index 998128596d6da6..e1e2c148e68380 100644 --- a/cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts +++ b/cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts @@ -3,7 +3,7 @@ import { assert, assertRejects, assertThrows, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { EncodingOption, existsSync, mkdtemp, mkdtempSync } from "node:fs"; import { env } from "node:process"; import { promisify } from "node:util"; diff --git a/cli/tests/unit_node/_fs/_fs_open_test.ts b/cli/tests/unit_node/_fs/_fs_open_test.ts index d9f5e57963457c..f7a7192b8ae38d 100644 --- a/cli/tests/unit_node/_fs/_fs_open_test.ts +++ b/cli/tests/unit_node/_fs/_fs_open_test.ts @@ -14,7 +14,7 @@ import { assertEquals, assertThrows, fail, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { open, openSync } from "node:fs"; import { join, parse } from "node:path"; diff --git a/cli/tests/unit_node/_fs/_fs_opendir_test.ts b/cli/tests/unit_node/_fs/_fs_opendir_test.ts index 196bea7778bb65..5219643f21b41c 100644 --- a/cli/tests/unit_node/_fs/_fs_opendir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_opendir_test.ts @@ -6,7 +6,7 @@ import { assertFalse, assertInstanceOf, assertThrows, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { opendir, opendirSync } from "node:fs"; import { Buffer } from "node:buffer"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; diff --git a/cli/tests/unit_node/_fs/_fs_readFile_test.ts b/cli/tests/unit_node/_fs/_fs_readFile_test.ts index 8fa9e7b010ce6c..335a7cfc76be0e 100644 --- a/cli/tests/unit_node/_fs/_fs_readFile_test.ts +++ b/cli/tests/unit_node/_fs/_fs_readFile_test.ts @@ -2,10 +2,7 @@ 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/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"); diff --git a/cli/tests/unit_node/_fs/_fs_read_test.ts b/cli/tests/unit_node/_fs/_fs_read_test.ts index 34b029d9faf493..547ba7874dfc18 100644 --- a/cli/tests/unit_node/_fs/_fs_read_test.ts +++ b/cli/tests/unit_node/_fs/_fs_read_test.ts @@ -4,7 +4,7 @@ import { assertFalse, assertMatch, assertStrictEquals, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { read, readSync } from "node:fs"; import { open, openSync } from "node:fs"; import { Buffer } from "node:buffer"; diff --git a/cli/tests/unit_node/_fs/_fs_readdir_test.ts b/cli/tests/unit_node/_fs/_fs_readdir_test.ts index bb1df079f9e980..b2ec353c548df3 100644 --- a/cli/tests/unit_node/_fs/_fs_readdir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_readdir_test.ts @@ -3,7 +3,7 @@ import { assertEquals, assertNotEquals, fail, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { readdir, readdirSync } from "node:fs"; import { join } from "../../../../test_util/std/path/mod.ts"; diff --git a/cli/tests/unit_node/_fs/_fs_readlink_test.ts b/cli/tests/unit_node/_fs/_fs_readlink_test.ts index 7f0d3cef83ad10..0d134023bf1cf8 100644 --- a/cli/tests/unit_node/_fs/_fs_readlink_test.ts +++ b/cli/tests/unit_node/_fs/_fs_readlink_test.ts @@ -1,10 +1,7 @@ // 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/testing/asserts.ts"; +import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts"; import * as path from "../../../../test_util/std/path/mod.ts"; const testDir = Deno.makeTempDirSync(); diff --git a/cli/tests/unit_node/_fs/_fs_realpath_test.ts b/cli/tests/unit_node/_fs/_fs_realpath_test.ts index 871ebe9836e54b..df7fb8da347d97 100644 --- a/cli/tests/unit_node/_fs/_fs_realpath_test.ts +++ b/cli/tests/unit_node/_fs/_fs_realpath_test.ts @@ -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/testing/asserts.ts"; +import { assertEquals } from "../../../../test_util/std/assert/mod.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { realpath, realpathSync } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_rename_test.ts b/cli/tests/unit_node/_fs/_fs_rename_test.ts index cefd7f61ad7755..8310cdb58aab5c 100644 --- a/cli/tests/unit_node/_fs/_fs_rename_test.ts +++ b/cli/tests/unit_node/_fs/_fs_rename_test.ts @@ -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 { rename, renameSync } from "node:fs"; import { existsSync } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_rm_test.ts b/cli/tests/unit_node/_fs/_fs_rm_test.ts index e196ee08a94bf5..cb4ae1aa165b61 100644 --- a/cli/tests/unit_node/_fs/_fs_rm_test.ts +++ b/cli/tests/unit_node/_fs/_fs_rm_test.ts @@ -4,7 +4,7 @@ import { assertRejects, assertThrows, fail, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { rm, rmSync } from "node:fs"; import { closeSync, existsSync } from "node:fs"; import { join } from "../../../../test_util/std/path/mod.ts"; diff --git a/cli/tests/unit_node/_fs/_fs_rmdir_test.ts b/cli/tests/unit_node/_fs/_fs_rmdir_test.ts index 85aaa2ec37eaa8..7bbae6270cba09 100644 --- a/cli/tests/unit_node/_fs/_fs_rmdir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_rmdir_test.ts @@ -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 { rmdir, rmdirSync } from "node:fs"; import { closeSync } from "node:fs"; import { existsSync } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_stat_test.ts b/cli/tests/unit_node/_fs/_fs_stat_test.ts index b9e33c5074af65..776d89ecc6ef51 100644 --- a/cli/tests/unit_node/_fs/_fs_stat_test.ts +++ b/cli/tests/unit_node/_fs/_fs_stat_test.ts @@ -1,10 +1,7 @@ // 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/testing/asserts.ts"; +import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts"; export function assertStats(actual: Stats, expected: Deno.FileInfo) { assertEquals(actual.dev, expected.dev); diff --git a/cli/tests/unit_node/_fs/_fs_symlink_test.ts b/cli/tests/unit_node/_fs/_fs_symlink_test.ts index 72747ebfaafa4d..f16188feec9499 100644 --- a/cli/tests/unit_node/_fs/_fs_symlink_test.ts +++ b/cli/tests/unit_node/_fs/_fs_symlink_test.ts @@ -3,7 +3,7 @@ import { assert, assertThrows, fail, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { symlink, symlinkSync } from "node:fs"; Deno.test({ diff --git a/cli/tests/unit_node/_fs/_fs_truncate_test.ts b/cli/tests/unit_node/_fs/_fs_truncate_test.ts index 3aff3fac27108a..98fb6c5f0ad9ca 100644 --- a/cli/tests/unit_node/_fs/_fs_truncate_test.ts +++ b/cli/tests/unit_node/_fs/_fs_truncate_test.ts @@ -3,7 +3,7 @@ import { assertEquals, assertThrows, fail, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { truncate, truncateSync } from "node:fs"; Deno.test({ diff --git a/cli/tests/unit_node/_fs/_fs_unlink_test.ts b/cli/tests/unit_node/_fs/_fs_unlink_test.ts index a33534fbb605fe..b92224844b0717 100644 --- a/cli/tests/unit_node/_fs/_fs_unlink_test.ts +++ b/cli/tests/unit_node/_fs/_fs_unlink_test.ts @@ -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 { existsSync } from "node:fs"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { unlink, unlinkSync } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_utimes_test.ts b/cli/tests/unit_node/_fs/_fs_utimes_test.ts index 170c0d73d8b70a..a2d3e605c1d5ae 100644 --- a/cli/tests/unit_node/_fs/_fs_utimes_test.ts +++ b/cli/tests/unit_node/_fs/_fs_utimes_test.ts @@ -3,7 +3,7 @@ import { assertEquals, assertThrows, fail, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { utimes, utimesSync } from "node:fs"; const randomDate = new Date(Date.now() + 1000); diff --git a/cli/tests/unit_node/_fs/_fs_watch_test.ts b/cli/tests/unit_node/_fs/_fs_watch_test.ts index 26b0da8b9749ee..9163435994ef1f 100644 --- a/cli/tests/unit_node/_fs/_fs_watch_test.ts +++ b/cli/tests/unit_node/_fs/_fs_watch_test.ts @@ -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/testing/asserts.ts"; +import { assertEquals } from "../../../../test_util/std/assert/mod.ts"; function wait(time: number) { return new Promise((resolve) => { diff --git a/cli/tests/unit_node/_fs/_fs_writeFile_test.ts b/cli/tests/unit_node/_fs/_fs_writeFile_test.ts index 9f123e005c236d..b96f4d29b5cfe0 100644 --- a/cli/tests/unit_node/_fs/_fs_writeFile_test.ts +++ b/cli/tests/unit_node/_fs/_fs_writeFile_test.ts @@ -5,7 +5,7 @@ import { assertNotEquals, assertRejects, assertThrows, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { writeFile, writeFileSync } from "node:fs"; import * as path from "../../../../test_util/std/path/mod.ts"; diff --git a/cli/tests/unit_node/_fs/_fs_write_test.ts b/cli/tests/unit_node/_fs/_fs_write_test.ts index 7baa81b7df7b92..afc15f29ff5685 100644 --- a/cli/tests/unit_node/_fs/_fs_write_test.ts +++ b/cli/tests/unit_node/_fs/_fs_write_test.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/testing/asserts.ts"; +import { assertEquals } from "../../../../test_util/std/assert/mod.ts"; import { Buffer } from "node:buffer"; const decoder = new TextDecoder("utf-8"); diff --git a/cli/tests/unit_node/_test_utils.ts b/cli/tests/unit_node/_test_utils.ts index 322067719868eb..514818bced8de4 100644 --- a/cli/tests/unit_node/_test_utils.ts +++ b/cli/tests/unit_node/_test_utils.ts @@ -3,7 +3,7 @@ import { assert, assertStringIncludes, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; /** Asserts that an error thrown in a callback will not be wrongly caught. */ export async function assertCallbackErrorUncaught( diff --git a/cli/tests/unit_node/assertion_error_test.ts b/cli/tests/unit_node/assertion_error_test.ts index ab6ed5bc3bc9fd..ac0636942240b6 100644 --- a/cli/tests/unit_node/assertion_error_test.ts +++ b/cli/tests/unit_node/assertion_error_test.ts @@ -3,7 +3,7 @@ import { stripColor } from "../../../test_util/std/fmt/colors.ts"; import { assert, assertStrictEquals, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; import { AssertionError } from "node:assert"; Deno.test({ diff --git a/cli/tests/unit_node/async_hooks_test.ts b/cli/tests/unit_node/async_hooks_test.ts index 871ad85f97ca79..adaa28593220a5 100644 --- a/cli/tests/unit_node/async_hooks_test.ts +++ b/cli/tests/unit_node/async_hooks_test.ts @@ -1,9 +1,6 @@ // 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/testing/asserts.ts"; +import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts"; import { deferred } from "../../../test_util/std/async/deferred.ts"; Deno.test(async function foo() { diff --git a/cli/tests/unit_node/buffer_test.ts b/cli/tests/unit_node/buffer_test.ts index 5244764c65a24d..cfd1bf748d8b00 100644 --- a/cli/tests/unit_node/buffer_test.ts +++ b/cli/tests/unit_node/buffer_test.ts @@ -3,7 +3,7 @@ import { Buffer } from "node:buffer"; import { assertEquals, assertThrows, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; Deno.test({ name: "[node/buffer] alloc fails if size is not a number", diff --git a/cli/tests/unit_node/child_process_test.ts b/cli/tests/unit_node/child_process_test.ts index 8d1c9a6b7394fe..aa053060ae1fc2 100644 --- a/cli/tests/unit_node/child_process_test.ts +++ b/cli/tests/unit_node/child_process_test.ts @@ -9,7 +9,7 @@ import { assertNotStrictEquals, assertStrictEquals, assertStringIncludes, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; import { Deferred, deferred } from "../../../test_util/std/async/deferred.ts"; import * as path from "../../../test_util/std/path/mod.ts"; diff --git a/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts b/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts index e1ef440581f367..2ed9c1d87bbc2e 100644 --- a/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts +++ b/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.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/testing/asserts.ts"; +import { assertEquals } from "../../../../test_util/std/assert/mod.ts"; const aesGcm = (bits: string, key: Uint8Array) => { const ALGO = bits == "128" ? `aes-128-gcm` : `aes-256-gcm`; diff --git a/cli/tests/unit_node/crypto/crypto_cipher_test.ts b/cli/tests/unit_node/crypto/crypto_cipher_test.ts index 0eecaacf062d15..52a9b06ec7a2cb 100644 --- a/cli/tests/unit_node/crypto/crypto_cipher_test.ts +++ b/cli/tests/unit_node/crypto/crypto_cipher_test.ts @@ -6,7 +6,7 @@ import { buffer, text } from "node:stream/consumers"; import { assertEquals, assertThrows, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; const rsaPrivateKey = Deno.readTextFileSync( new URL("../testdata/rsa_private.pem", import.meta.url), diff --git a/cli/tests/unit_node/crypto/crypto_hash_test.ts b/cli/tests/unit_node/crypto/crypto_hash_test.ts index 4b0aedf039bd5f..3167628ceea456 100644 --- a/cli/tests/unit_node/crypto/crypto_hash_test.ts +++ b/cli/tests/unit_node/crypto/crypto_hash_test.ts @@ -8,10 +8,7 @@ import { } from "node:crypto"; import { Buffer } from "node:buffer"; import { Readable } from "node:stream"; -import { - assert, - assertEquals, -} from "../../../../test_util/std/testing/asserts.ts"; +import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts"; // https://github.com/denoland/deno/issues/18140 Deno.test({ diff --git a/cli/tests/unit_node/crypto/crypto_key_test.ts b/cli/tests/unit_node/crypto/crypto_key_test.ts index 672c9fa7f06788..a91461969990dc 100644 --- a/cli/tests/unit_node/crypto/crypto_key_test.ts +++ b/cli/tests/unit_node/crypto/crypto_key_test.ts @@ -13,7 +13,7 @@ import { Buffer } from "node:buffer"; import { assertEquals, assertThrows, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { createHmac } from "node:crypto"; const generateKeyPairAsync = promisify( diff --git a/cli/tests/unit_node/crypto/crypto_sign_test.ts b/cli/tests/unit_node/crypto/crypto_sign_test.ts index 9988ed71c3e811..58107b563ac482 100644 --- a/cli/tests/unit_node/crypto/crypto_sign_test.ts +++ b/cli/tests/unit_node/crypto/crypto_sign_test.ts @@ -1,9 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { - assert, - assertEquals, -} from "../../../../test_util/std/testing/asserts.ts"; +import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts"; import { createSign, createVerify, sign, verify } from "node:crypto"; import { Buffer } from "node:buffer"; diff --git a/cli/tests/unit_node/fs_test.ts b/cli/tests/unit_node/fs_test.ts index 3e9ad44802f04d..310113233e03de 100644 --- a/cli/tests/unit_node/fs_test.ts +++ b/cli/tests/unit_node/fs_test.ts @@ -1,9 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { - assert, - assertThrows, -} from "../../../test_util/std/testing/asserts.ts"; +import { assert, assertThrows } from "../../../test_util/std/assert/mod.ts"; import { join } from "node:path"; import { tmpdir } from "node:os"; import { mkdtempSync, readFileSync, writeFileSync } from "node:fs"; diff --git a/cli/tests/unit_node/http2_test.ts b/cli/tests/unit_node/http2_test.ts index d0e0de43f1e90c..aa17c81fc99ae3 100644 --- a/cli/tests/unit_node/http2_test.ts +++ b/cli/tests/unit_node/http2_test.ts @@ -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/testing/asserts.ts"; +import { assertEquals } from "../../../test_util/std/assert/mod.ts"; for (const url of ["http://127.0.0.1:4246", "https://127.0.0.1:4247"]) { Deno.test(`[node/http2 client] ${url}`, { diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts index 825815ae646ae9..07b7d0e20fec88 100644 --- a/cli/tests/unit_node/http_test.ts +++ b/cli/tests/unit_node/http_test.ts @@ -7,7 +7,7 @@ import { assert, assertEquals, fail, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; import { assertSpyCalls, spy } from "../../../test_util/std/testing/mock.ts"; import { deferred } from "../../../test_util/std/async/deferred.ts"; diff --git a/cli/tests/unit_node/internal/_randomBytes_test.ts b/cli/tests/unit_node/internal/_randomBytes_test.ts index 1072ce164b432c..69845705e8916f 100644 --- a/cli/tests/unit_node/internal/_randomBytes_test.ts +++ b/cli/tests/unit_node/internal/_randomBytes_test.ts @@ -4,7 +4,7 @@ import { assertEquals, assertRejects, assertThrows, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { randomBytes } from "node:crypto"; diff --git a/cli/tests/unit_node/internal/_randomFill_test.ts b/cli/tests/unit_node/internal/_randomFill_test.ts index 5e2e154c8e6ff9..537a11e5efe1f6 100644 --- a/cli/tests/unit_node/internal/_randomFill_test.ts +++ b/cli/tests/unit_node/internal/_randomFill_test.ts @@ -5,7 +5,7 @@ import { assertEquals, assertNotEquals, assertThrows, -} from "../../../../test_util/std/testing/asserts.ts"; +} from "../../../../test_util/std/assert/mod.ts"; import { deferred } from "../../../../test_util/std/async/deferred.ts"; const validateNonZero = (buf: Buffer) => { diff --git a/cli/tests/unit_node/internal/_randomInt_test.ts b/cli/tests/unit_node/internal/_randomInt_test.ts index 4bed13498eb75a..36d8a2146a0d41 100644 --- a/cli/tests/unit_node/internal/_randomInt_test.ts +++ b/cli/tests/unit_node/internal/_randomInt_test.ts @@ -1,9 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. import { randomInt } from "node:crypto"; -import { - assert, - assertThrows, -} from "../../../../test_util/std/testing/asserts.ts"; +import { assert, assertThrows } from "../../../../test_util/std/assert/mod.ts"; const between = (x: number, min: number, max: number) => x >= min && x < max; diff --git a/cli/tests/unit_node/internal/pbkdf2_test.ts b/cli/tests/unit_node/internal/pbkdf2_test.ts index 3d3378769d560e..79c379d9a2af45 100644 --- a/cli/tests/unit_node/internal/pbkdf2_test.ts +++ b/cli/tests/unit_node/internal/pbkdf2_test.ts @@ -1,9 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. import { pbkdf2, pbkdf2Sync } from "node:crypto"; -import { - assert, - assertEquals, -} from "../../../../test_util/std/testing/asserts.ts"; +import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts"; type Algorithms = | "md5" diff --git a/cli/tests/unit_node/internal/scrypt_test.ts b/cli/tests/unit_node/internal/scrypt_test.ts index d65cd27fffbdcb..6081df5f32e8f1 100644 --- a/cli/tests/unit_node/internal/scrypt_test.ts +++ b/cli/tests/unit_node/internal/scrypt_test.ts @@ -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/testing/asserts.ts"; +import { assertEquals } from "../../../../test_util/std/assert/mod.ts"; import { deferred } from "../../../../test_util/std/async/deferred.ts"; Deno.test("scrypt works correctly", async () => { diff --git a/cli/tests/unit_node/module_test.ts b/cli/tests/unit_node/module_test.ts index 9818f4766cdeb2..8ecef7fa40c7ee 100644 --- a/cli/tests/unit_node/module_test.ts +++ b/cli/tests/unit_node/module_test.ts @@ -1,10 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. import { createRequire, Module } from "node:module"; -import { - assert, - assertEquals, -} from "../../../test_util/std/testing/asserts.ts"; +import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts"; import process from "node:process"; import * as path from "node:path"; diff --git a/cli/tests/unit_node/net_test.ts b/cli/tests/unit_node/net_test.ts index ca9d214e191181..9567defe6e7838 100644 --- a/cli/tests/unit_node/net_test.ts +++ b/cli/tests/unit_node/net_test.ts @@ -1,10 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. import * as net from "node:net"; -import { - assert, - assertEquals, -} from "../../../test_util/std/testing/asserts.ts"; +import { assert, assertEquals } from "../../../test_util/std/assert/mod.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"; diff --git a/cli/tests/unit_node/os_test.ts b/cli/tests/unit_node/os_test.ts index 2d0d3a8c80dfc3..48e241027d9749 100644 --- a/cli/tests/unit_node/os_test.ts +++ b/cli/tests/unit_node/os_test.ts @@ -7,7 +7,7 @@ import { assertEquals, assertNotEquals, assertThrows, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; Deno.test({ name: "build architecture is a string", diff --git a/cli/tests/unit_node/path_test.ts b/cli/tests/unit_node/path_test.ts index 48298afec3a97c..8b1af9ee19fc34 100644 --- a/cli/tests/unit_node/path_test.ts +++ b/cli/tests/unit_node/path_test.ts @@ -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/testing/asserts.ts"; +import { assertStrictEquals } from "../../../test_util/std/assert/mod.ts"; Deno.test("[node/path] posix and win32 objects", () => { assertStrictEquals(path.posix, posix); diff --git a/cli/tests/unit_node/perf_hooks_test.ts b/cli/tests/unit_node/perf_hooks_test.ts index 2249e62f8244e8..2866f0d40491ff 100644 --- a/cli/tests/unit_node/perf_hooks_test.ts +++ b/cli/tests/unit_node/perf_hooks_test.ts @@ -4,7 +4,7 @@ import { performance } from "node:perf_hooks"; import { assertEquals, assertThrows, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; Deno.test({ name: "[perf_hooks] performance", diff --git a/cli/tests/unit_node/process_test.ts b/cli/tests/unit_node/process_test.ts index 1f4638b91e44b4..eeac1b67f3cc75 100644 --- a/cli/tests/unit_node/process_test.ts +++ b/cli/tests/unit_node/process_test.ts @@ -11,7 +11,7 @@ import { assertObjectMatch, assertStrictEquals, assertThrows, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.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"; diff --git a/cli/tests/unit_node/querystring_test.ts b/cli/tests/unit_node/querystring_test.ts index 0b3b22d62d6aa2..bd5548223ec6f3 100644 --- a/cli/tests/unit_node/querystring_test.ts +++ b/cli/tests/unit_node/querystring_test.ts @@ -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 { parse, stringify } from "node:querystring"; Deno.test({ diff --git a/cli/tests/unit_node/readline_test.ts b/cli/tests/unit_node/readline_test.ts index 914d23e4aff5db..8978b53ff56213 100644 --- a/cli/tests/unit_node/readline_test.ts +++ b/cli/tests/unit_node/readline_test.ts @@ -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/testing/asserts.ts"; +import { assertInstanceOf } from "../../../test_util/std/assert/mod.ts"; import { Readable, Writable } from "node:stream"; Deno.test("[node/readline] createInstance", () => { diff --git a/cli/tests/unit_node/repl_test.ts b/cli/tests/unit_node/repl_test.ts index e703d69f8b9873..9df8d03757965c 100644 --- a/cli/tests/unit_node/repl_test.ts +++ b/cli/tests/unit_node/repl_test.ts @@ -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/testing/asserts.ts"; +import { assert } from "../../../test_util/std/assert/mod.ts"; Deno.test({ name: "repl module exports", diff --git a/cli/tests/unit_node/stream_test.ts b/cli/tests/unit_node/stream_test.ts index 058d3ca7c6e412..9d3d3df082a6ea 100644 --- a/cli/tests/unit_node/stream_test.ts +++ b/cli/tests/unit_node/stream_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { assert } from "../../../test_util/std/testing/asserts.ts"; +import { assert } from "../../../test_util/std/assert/mod.ts"; import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts"; import { pipeline } from "node:stream/promises"; import { createReadStream, createWriteStream } from "node:fs"; diff --git a/cli/tests/unit_node/string_decoder_test.ts b/cli/tests/unit_node/string_decoder_test.ts index 93ff69dc326747..facd4cc4ec4a40 100644 --- a/cli/tests/unit_node/string_decoder_test.ts +++ b/cli/tests/unit_node/string_decoder_test.ts @@ -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 { Buffer } from "node:buffer"; import { StringDecoder } from "node:string_decoder"; diff --git a/cli/tests/unit_node/timers_test.ts b/cli/tests/unit_node/timers_test.ts index d110b44e4577fe..f6c8f7773efeb1 100644 --- a/cli/tests/unit_node/timers_test.ts +++ b/cli/tests/unit_node/timers_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -import { assert, fail } from "../../../test_util/std/testing/asserts.ts"; +import { assert, fail } from "../../../test_util/std/assert/mod.ts"; import * as timers from "node:timers"; import * as timersPromises from "node:timers/promises"; diff --git a/cli/tests/unit_node/tls_test.ts b/cli/tests/unit_node/tls_test.ts index 7a270c60b3fa4d..aeb7cf5eaec9c4 100644 --- a/cli/tests/unit_node/tls_test.ts +++ b/cli/tests/unit_node/tls_test.ts @@ -3,7 +3,7 @@ import { assertEquals, assertInstanceOf, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; import { delay } from "../../../test_util/std/async/delay.ts"; import { deferred } from "../../../test_util/std/async/deferred.ts"; import { fromFileUrl, join } from "../../../test_util/std/path/mod.ts"; diff --git a/cli/tests/unit_node/tty_test.ts b/cli/tests/unit_node/tty_test.ts index d2bf32efcbea80..930f1aaffacbc3 100644 --- a/cli/tests/unit_node/tty_test.ts +++ b/cli/tests/unit_node/tty_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // deno-lint-ignore-file no-explicit-any -import { assert } from "../../../test_util/std/testing/asserts.ts"; +import { assert } from "../../../test_util/std/assert/mod.ts"; import { isatty } from "node:tty"; Deno.test("[node/tty isatty] returns true when fd is a tty, false otherwise", () => { diff --git a/cli/tests/unit_node/util_test.ts b/cli/tests/unit_node/util_test.ts index 81794c856ff4c2..87d59019ffc48c 100644 --- a/cli/tests/unit_node/util_test.ts +++ b/cli/tests/unit_node/util_test.ts @@ -5,7 +5,7 @@ import { assertEquals, assertStrictEquals, assertThrows, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; import { stripColor } from "../../../test_util/std/fmt/colors.ts"; import * as util from "node:util"; diff --git a/cli/tests/unit_node/v8_test.ts b/cli/tests/unit_node/v8_test.ts index 724ac35044db0e..8eb67701e5bc65 100644 --- a/cli/tests/unit_node/v8_test.ts +++ b/cli/tests/unit_node/v8_test.ts @@ -4,7 +4,7 @@ import { getHeapStatistics, setFlagsFromString, } from "node:v8"; -import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; +import { assertEquals } from "../../../test_util/std/assert/mod.ts"; // https://github.com/nodejs/node/blob/a2bbe5ff216bc28f8dac1c36a8750025a93c3827/test/parallel/test-v8-version-tag.js#L6 Deno.test({ diff --git a/cli/tests/unit_node/worker_threads_test.ts b/cli/tests/unit_node/worker_threads_test.ts index a43a1b50600b11..0271995e644a70 100644 --- a/cli/tests/unit_node/worker_threads_test.ts +++ b/cli/tests/unit_node/worker_threads_test.ts @@ -4,7 +4,7 @@ import { assert, assertEquals, assertObjectMatch, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts"; import * as workerThreads from "node:worker_threads"; import { EventEmitter, once } from "node:events"; diff --git a/cli/tests/unit_node/zlib_test.ts b/cli/tests/unit_node/zlib_test.ts index b878b7cc3294e5..50bf7f11a4e0a2 100644 --- a/cli/tests/unit_node/zlib_test.ts +++ b/cli/tests/unit_node/zlib_test.ts @@ -1,9 +1,6 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -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"; import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts"; import { diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index e51e9736a9e5c7..0968ba3a0a05c5 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -544,7 +544,7 @@ declare namespace Deno { * Examples: * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test({ * name: "inherit", @@ -559,7 +559,7 @@ declare namespace Deno { * ``` * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test({ * name: "true", @@ -574,7 +574,7 @@ declare namespace Deno { * ``` * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test({ * name: "false", @@ -589,7 +589,7 @@ declare namespace Deno { * ``` * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test({ * name: "localhost:8080", @@ -821,7 +821,7 @@ declare namespace Deno { * `fn` can be async if required. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test({ * name: "example test", @@ -858,7 +858,7 @@ declare namespace Deno { * `fn` can be async if required. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test("My test description", () => { * assertEquals("hello", "hello"); @@ -884,7 +884,7 @@ declare namespace Deno { * `fn` can be async if required. Declared function must have a name. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test(function myTestName() { * assertEquals("hello", "hello"); @@ -907,7 +907,7 @@ declare namespace Deno { * `fn` can be async if required. * * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; + * import {assert, fail, assertEquals} from "https://deno.land/std/assert/mod.ts"; * * Deno.test("My test description", { permissions: { read: true } }, (): void => { * assertEquals("hello", "hello"); @@ -934,7 +934,7 @@ declare namespace Deno { * `fn` can be async if required. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test( * { @@ -972,7 +972,7 @@ declare namespace Deno { * `fn` can be async if required. Declared function must have a name. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.test( * { permissions: { read: true } }, @@ -1196,7 +1196,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.bench({ * name: "example test", @@ -1235,7 +1235,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.bench("My test description", () => { * assertEquals("hello", "hello"); @@ -1263,7 +1263,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.bench(function myTestName() { * assertEquals("hello", "hello"); @@ -1288,7 +1288,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.bench( * "My test description", @@ -1325,7 +1325,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.bench( * { name: "My test description", permissions: { read: true } }, @@ -1359,7 +1359,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; + * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; * * Deno.bench( * { permissions: { read: true } }, @@ -2420,7 +2420,7 @@ declare namespace Deno { /** Resolves to a {@linkcode Deno.FileInfo} for the file. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * * const file = await Deno.open("hello.txt"); * const fileInfo = await file.stat(); @@ -2432,7 +2432,7 @@ declare namespace Deno { /** Synchronously returns a {@linkcode Deno.FileInfo} for the file. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * * const file = Deno.openSync("hello.txt") * const fileInfo = file.statSync(); @@ -3485,7 +3485,7 @@ declare namespace Deno { * of what it points to. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * const fileInfo = await Deno.lstat("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -3502,7 +3502,7 @@ declare namespace Deno { * returned instead of what it points to. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * const fileInfo = Deno.lstatSync("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -3518,7 +3518,7 @@ declare namespace Deno { * always follow symlinks. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * const fileInfo = await Deno.stat("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -3534,7 +3534,7 @@ declare namespace Deno { * `path`. Will always follow symlinks. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * const fileInfo = Deno.statSync("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -4762,7 +4762,7 @@ declare namespace Deno { /** Revokes a permission, and resolves to the state of the permission. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * * const status = await Deno.permissions.revoke({ name: "run" }); * assert(status.state !== "granted") @@ -4773,7 +4773,7 @@ declare namespace Deno { /** Revokes a permission, and returns the state of the permission. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * * const status = Deno.permissions.revokeSync({ name: "run" }); * assert(status.state !== "granted") @@ -4851,14 +4851,14 @@ declare namespace Deno { * ### Revoking * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * * const status = await Deno.permissions.revoke({ name: "run" }); * assert(status.state !== "granted") * ``` * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * * const status = Deno.permissions.revokeSync({ name: "run" }); * assert(status.state !== "granted") @@ -5168,7 +5168,7 @@ declare namespace Deno { * Returns a `Deno.FileInfo` for the given file stream. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * * const file = await Deno.open("file.txt", { read: true }); * const fileInfo = await Deno.fstat(file.rid); @@ -5184,7 +5184,7 @@ declare namespace Deno { * stream. * * ```ts - * import { assert } from "https://deno.land/std/testing/asserts.ts"; + * import { assert } from "https://deno.land/std/assert/mod.ts"; * * const file = Deno.openSync("file.txt", { read: true }); * const fileInfo = Deno.fstatSync(file.rid); diff --git a/test_ffi/tests/test.js b/test_ffi/tests/test.js index 80c5663980d456..62b23c36e65af0 100644 --- a/test_ffi/tests/test.js +++ b/test_ffi/tests/test.js @@ -10,7 +10,7 @@ import { assertInstanceOf, assertEquals, assertFalse, -} from "../../test_util/std/testing/asserts.ts"; +} from "../../test_util/std/assert/mod.ts"; const targetDir = Deno.execPath().replace(/[^\/\\]+$/, ""); const [libPrefix, libSuffix] = { diff --git a/test_napi/common.js b/test_napi/common.js index ede045666984bb..6ed9c63a06a312 100644 --- a/test_napi/common.js +++ b/test_napi/common.js @@ -5,7 +5,7 @@ export { assertEquals, assertRejects, assertThrows, -} from "../test_util/std/testing/asserts.ts"; +} from "../test_util/std/assert/mod.ts"; export { fromFileUrl } from "../test_util/std/path/mod.ts"; import process from "node:process"; diff --git a/test_util/std b/test_util/std index b23a76a47adaf6..413dd7928ca770 160000 --- a/test_util/std +++ b/test_util/std @@ -1 +1 @@ -Subproject commit b23a76a47adaf63b5493761a87e6dd0dc0de0bb8 +Subproject commit 413dd7928ca77043f4d3dcd6d3abc64bbfab3cd2 From 4c6b986f17ff482052793c821d2901699ddc0804 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Fri, 27 Oct 2023 14:15:09 -0700 Subject: [PATCH 04/10] chore(ext/crypto): upgrade to ring 0.17 (#20824) Ref https://github.com/denoland/deno/issues/18071 --- Cargo.lock | 45 +++++++++++++++++++++----------------- Cargo.toml | 6 ++--- cli/Cargo.toml | 2 +- ext/crypto/generate_key.rs | 2 +- ext/crypto/import_key.rs | 5 ++++- ext/crypto/lib.rs | 8 ++++--- ext/node/ops/crypto/mod.rs | 2 +- 7 files changed, 40 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fcfb8b9b24aaa..75890118418d35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1161,9 +1161,9 @@ dependencies = [ [[package]] name = "deno_cache_dir" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "026d622a8251c427bdb506798b003926b059640a247d524e1f773751cce9f0bf" +checksum = "2bbb245d9a3719b5eb2b5195aaaa25108c3c93d1762b181a20fb1af1c7703eaf" dependencies = [ "anyhow", "deno_media_type", @@ -1469,9 +1469,9 @@ dependencies = [ [[package]] name = "deno_lockfile" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7673d66847223bd4115075a96b0699da71b1755524aeb3956f0a3edf3af3217" +checksum = "8cd29f62e6dec60e585f579df3e9c2fc562aadf881319152974bc442a9042077" dependencies = [ "ring", "serde", @@ -3120,7 +3120,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] @@ -4384,17 +4384,16 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "911b295d2d302948838c8ac142da1ee09fa7863163b44e6715bc9357905878b8" dependencies = [ "cc", + "getrandom 0.2.10", "libc", - "once_cell", - "spin", + "spin 0.9.8", "untrusted", - "web-sys", - "winapi", + "windows-sys", ] [[package]] @@ -4495,9 +4494,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", "ring", @@ -4528,9 +4527,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", @@ -4640,9 +4639,9 @@ dependencies = [ [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -4993,6 +4992,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.6.0" @@ -6104,7 +6109,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if 0.1.10", "rand 0.8.5", "static_assertions", ] @@ -6234,9 +6239,9 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" diff --git a/Cargo.toml b/Cargo.toml index 81e0f388c85df9..77f229e04d62f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ deno_runtime = { version = "0.129.0", path = "./runtime" } napi_sym = { version = "0.51.0", path = "./cli/napi/sym" } deno_bench_util = { version = "0.115.0", path = "./bench_util" } test_util = { path = "./test_util" } -deno_lockfile = "0.17.1" +deno_lockfile = "0.17.2" deno_media_type = { version = "0.1.1", features = ["module_specifier"] } # exts @@ -118,9 +118,9 @@ rand = "=0.8.5" regex = "^1.7.0" lazy-regex = "3" reqwest = { version = "0.11.20", default-features = false, features = ["rustls-tls", "stream", "gzip", "brotli", "socks", "json"] } -ring = "=0.16.20" +ring = "^0.17.0" rusqlite = { version = "=0.29.0", features = ["unlock_notify", "bundled"] } -rustls = "0.21.0" +rustls = "0.21.8" rustls-pemfile = "1.0.0" rustls-webpki = "0.101.4" rustls-native-certs = "0.6.2" diff --git a/cli/Cargo.toml b/cli/Cargo.toml index b6547c2b3d4860..5f540625439702 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -46,7 +46,7 @@ winres.workspace = true [dependencies] deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "dep_graph", "module_specifier", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] } -deno_cache_dir = "=0.6.0" +deno_cache_dir = "=0.6.1" deno_config = "=0.4.0" deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_doc = "=0.70.0" diff --git a/ext/crypto/generate_key.rs b/ext/crypto/generate_key.rs index abe7ef1ee5e60d..bda3d3226f2124 100644 --- a/ext/crypto/generate_key.rs +++ b/ext/crypto/generate_key.rs @@ -136,7 +136,7 @@ fn generate_key_hmac( length } else { - hash.digest_algorithm().block_len + hash.digest_algorithm().block_len() }; let rng = ring::rand::SystemRandom::new(); diff --git a/ext/crypto/import_key.rs b/ext/crypto/import_key.rs index 0a864d68cd8cec..8ef73a8c44c1e9 100644 --- a/ext/crypto/import_key.rs +++ b/ext/crypto/import_key.rs @@ -556,10 +556,12 @@ fn import_key_ec_jwk( } }; + let rng = ring::rand::SystemRandom::new(); let _key_pair = EcdsaKeyPair::from_private_key_and_public_key( key_alg, private_d.as_bytes(), point_bytes.as_ref(), + &rng, ); Ok(ImportKeyResult::Ec { @@ -658,8 +660,9 @@ fn import_key_ec( } }; + let rng = ring::rand::SystemRandom::new(); // deserialize pkcs8 using ring crate, to VALIDATE public key - let _private_key = EcdsaKeyPair::from_pkcs8(signing_alg, &data)?; + let _private_key = EcdsaKeyPair::from_pkcs8(signing_alg, &data, &rng)?; // 11. if named_curve != pk_named_curve { diff --git a/ext/crypto/lib.rs b/ext/crypto/lib.rs index 3be6bcc3db8743..87b9702ce06e9b 100644 --- a/ext/crypto/lib.rs +++ b/ext/crypto/lib.rs @@ -266,7 +266,8 @@ pub async fn op_crypto_sign_key( let curve: &EcdsaSigningAlgorithm = args.named_curve.ok_or_else(not_supported)?.try_into()?; - let key_pair = EcdsaKeyPair::from_pkcs8(curve, &args.key.data)?; + let rng = RingRand::SystemRandom::new(); + let key_pair = EcdsaKeyPair::from_pkcs8(curve, &args.key.data, &rng)?; // We only support P256-SHA256 & P384-SHA384. These are recommended signature pairs. // https://briansmith.org/rustdoc/ring/signature/index.html#statics if let Some(hash) = args.hash { @@ -276,7 +277,6 @@ pub async fn op_crypto_sign_key( } }; - let rng = RingRand::SystemRandom::new(); let signature = key_pair.sign(&rng, data)?; // Signature data as buffer. @@ -388,7 +388,9 @@ pub async fn op_crypto_verify_key( let public_key_bytes = match args.key.r#type { KeyType::Private => { - private_key = EcdsaKeyPair::from_pkcs8(signing_alg, &args.key.data)?; + let rng = RingRand::SystemRandom::new(); + private_key = + EcdsaKeyPair::from_pkcs8(signing_alg, &args.key.data, &rng)?; private_key.public_key().as_ref() } diff --git a/ext/node/ops/crypto/mod.rs b/ext/node/ops/crypto/mod.rs index 372f7dcb50ef90..bf7a99ba04d901 100644 --- a/ext/node/ops/crypto/mod.rs +++ b/ext/node/ops/crypto/mod.rs @@ -715,7 +715,7 @@ fn ec_generate( let pkcs8 = EcdsaKeyPair::generate_pkcs8(curve, &rng) .map_err(|_| type_error("Failed to generate EC key"))?; - let public_key = EcdsaKeyPair::from_pkcs8(curve, pkcs8.as_ref()) + let public_key = EcdsaKeyPair::from_pkcs8(curve, pkcs8.as_ref(), &rng) .map_err(|_| type_error("Failed to generate EC key"))? .public_key() .as_ref() From e7abb705f96fab85ee2e9dd09b10902e10350d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 28 Oct 2023 03:24:37 +0200 Subject: [PATCH 05/10] Revert "chore: update deno_std submodule (#20994)" (#21001) This reverts commit 6e2abb2b13af5dff5d631fb1bc0c279c49ebd066. --- cli/tests/integration/compile_tests.rs | 3 +- cli/tests/node_compat/common.ts | 2 +- cli/tests/node_compat/test.ts | 2 +- cli/tests/testdata/bench/allow_all.ts | 2 +- cli/tests/testdata/bench/allow_none.ts | 2 +- .../testdata/cert/listen_tls_alpn_fail.ts | 2 +- .../compile/standalone_follow_redirects_2.js | 2 +- cli/tests/testdata/compile/welcome.ts | 1 - .../coverage/no_tests_included/foo.test.js | 2 +- .../coverage/no_tests_included/foo.test.mts | 2 +- .../coverage/no_tests_included/foo.test.ts | 2 +- .../no_transpiled_lines/expected.lcov | 6 +- .../coverage/no_transpiled_lines/expected.out | 2 +- .../coverage/no_transpiled_lines/index.ts | 4 +- cli/tests/testdata/run/045_proxy_test.ts | 2 +- cli/tests/testdata/run/import_meta/main.ts | 2 +- cli/tests/testdata/run/onload/imported.ts | 2 +- cli/tests/testdata/run/onload/main.ts | 2 +- .../testdata/run/onload/nest_imported.ts | 2 +- cli/tests/testdata/run/tls_connecttls.js | 5 +- cli/tests/testdata/run/tls_starttls.js | 5 +- .../run/websocket_server_idletimeout.ts | 2 +- cli/tests/testdata/run/websocket_test.ts | 2 +- .../testdata/run/websocketstream_test.ts | 2 +- cli/tests/testdata/test/allow_all.ts | 2 +- cli/tests/testdata/test/allow_none.ts | 2 +- cli/tests/testdata/workers/deno_worker.ts | 2 +- cli/tests/testdata/workers/test.ts | 2 +- cli/tests/unit/broadcast_channel_test.ts | 2 +- cli/tests/unit/message_channel_test.ts | 5 +- cli/tests/unit/opcall_test.ts | 2 +- cli/tests/unit/serve_test.ts | 2 +- cli/tests/unit/test_util.ts | 2 +- cli/tests/unit_node/_fs/_fs_access_test.ts | 2 +- .../unit_node/_fs/_fs_appendFile_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_chmod_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_chown_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_close_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_copy_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_dir_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_dirent_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_exists_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_fdatasync_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_fstat_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_fsync_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_ftruncate_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_futimes_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_handle_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_link_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_lstat_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_mkdir_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_open_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_opendir_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_readFile_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_read_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_readdir_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_readlink_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_realpath_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_rename_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_rm_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_rmdir_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_stat_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_symlink_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_truncate_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_unlink_test.ts | 5 +- cli/tests/unit_node/_fs/_fs_utimes_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_watch_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_writeFile_test.ts | 2 +- cli/tests/unit_node/_fs/_fs_write_test.ts | 2 +- cli/tests/unit_node/_test_utils.ts | 2 +- cli/tests/unit_node/assertion_error_test.ts | 2 +- cli/tests/unit_node/async_hooks_test.ts | 5 +- cli/tests/unit_node/buffer_test.ts | 2 +- cli/tests/unit_node/child_process_test.ts | 2 +- .../crypto/crypto_cipher_gcm_test.ts | 2 +- .../unit_node/crypto/crypto_cipher_test.ts | 2 +- .../unit_node/crypto/crypto_hash_test.ts | 5 +- cli/tests/unit_node/crypto/crypto_key_test.ts | 2 +- .../unit_node/crypto/crypto_sign_test.ts | 5 +- cli/tests/unit_node/fs_test.ts | 5 +- cli/tests/unit_node/http2_test.ts | 2 +- cli/tests/unit_node/http_test.ts | 2 +- .../unit_node/internal/_randomBytes_test.ts | 2 +- .../unit_node/internal/_randomFill_test.ts | 2 +- .../unit_node/internal/_randomInt_test.ts | 5 +- cli/tests/unit_node/internal/pbkdf2_test.ts | 5 +- cli/tests/unit_node/internal/scrypt_test.ts | 2 +- cli/tests/unit_node/module_test.ts | 5 +- cli/tests/unit_node/net_test.ts | 5 +- cli/tests/unit_node/os_test.ts | 2 +- cli/tests/unit_node/path_test.ts | 2 +- cli/tests/unit_node/perf_hooks_test.ts | 2 +- cli/tests/unit_node/process_test.ts | 2 +- cli/tests/unit_node/querystring_test.ts | 2 +- cli/tests/unit_node/readline_test.ts | 2 +- cli/tests/unit_node/repl_test.ts | 2 +- cli/tests/unit_node/stream_test.ts | 2 +- cli/tests/unit_node/string_decoder_test.ts | 2 +- cli/tests/unit_node/timers_test.ts | 2 +- cli/tests/unit_node/tls_test.ts | 2 +- cli/tests/unit_node/tty_test.ts | 2 +- cli/tests/unit_node/util_test.ts | 2 +- cli/tests/unit_node/v8_test.ts | 2 +- cli/tests/unit_node/worker_threads_test.ts | 2 +- cli/tests/unit_node/zlib_test.ts | 5 +- cli/tsc/dts/lib.deno.ns.d.ts | 56 +++++++++---------- test_ffi/tests/test.js | 2 +- test_napi/common.js | 2 +- test_util/std | 2 +- 110 files changed, 207 insertions(+), 139 deletions(-) delete mode 100644 cli/tests/testdata/compile/welcome.ts diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs index 4835bacc8afeeb..3ca57a35f44f8e 100644 --- a/cli/tests/integration/compile_tests.rs +++ b/cli/tests/integration/compile_tests.rs @@ -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); diff --git a/cli/tests/node_compat/common.ts b/cli/tests/node_compat/common.ts index 7de7026cd4e8e7..1b9748f26f60ed 100644 --- a/cli/tests/node_compat/common.ts +++ b/cli/tests/node_compat/common.ts @@ -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 diff --git a/cli/tests/node_compat/test.ts b/cli/tests/node_compat/test.ts index acd45ffe62242c..52bb6810c1dabe 100644 --- a/cli/tests/node_compat/test.ts +++ b/cli/tests/node_compat/test.ts @@ -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, diff --git a/cli/tests/testdata/bench/allow_all.ts b/cli/tests/testdata/bench/allow_all.ts index beb4a450e5ed6f..d7dde3a855abbb 100644 --- a/cli/tests/testdata/bench/allow_all.ts +++ b/cli/tests/testdata/bench/allow_all.ts @@ -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", diff --git a/cli/tests/testdata/bench/allow_none.ts b/cli/tests/testdata/bench/allow_none.ts index e723ed8684aed5..778e98420a6923 100644 --- a/cli/tests/testdata/bench/allow_none.ts +++ b/cli/tests/testdata/bench/allow_none.ts @@ -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", diff --git a/cli/tests/testdata/cert/listen_tls_alpn_fail.ts b/cli/tests/testdata/cert/listen_tls_alpn_fail.ts index c1aa4b31d0f02e..da60383f0a0209 100644 --- a/cli/tests/testdata/cert/listen_tls_alpn_fail.ts +++ b/cli/tests/testdata/cert/listen_tls_alpn_fail.ts @@ -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]), diff --git a/cli/tests/testdata/compile/standalone_follow_redirects_2.js b/cli/tests/testdata/compile/standalone_follow_redirects_2.js index 00ebc0f5c9bae8..a1bf83875809a2 100644 --- a/cli/tests/testdata/compile/standalone_follow_redirects_2.js +++ b/cli/tests/testdata/compile/standalone_follow_redirects_2.js @@ -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"; diff --git a/cli/tests/testdata/compile/welcome.ts b/cli/tests/testdata/compile/welcome.ts deleted file mode 100644 index f983ca89baec1b..00000000000000 --- a/cli/tests/testdata/compile/welcome.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("Welcome to Deno!"); diff --git a/cli/tests/testdata/coverage/no_tests_included/foo.test.js b/cli/tests/testdata/coverage/no_tests_included/foo.test.js index f555c2d0a6b128..12da76d02b6b86 100644 --- a/cli/tests/testdata/coverage/no_tests_included/foo.test.js +++ b/cli/tests/testdata/coverage/no_tests_included/foo.test.js @@ -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); diff --git a/cli/tests/testdata/coverage/no_tests_included/foo.test.mts b/cli/tests/testdata/coverage/no_tests_included/foo.test.mts index f555c2d0a6b128..12da76d02b6b86 100644 --- a/cli/tests/testdata/coverage/no_tests_included/foo.test.mts +++ b/cli/tests/testdata/coverage/no_tests_included/foo.test.mts @@ -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); diff --git a/cli/tests/testdata/coverage/no_tests_included/foo.test.ts b/cli/tests/testdata/coverage/no_tests_included/foo.test.ts index f555c2d0a6b128..12da76d02b6b86 100644 --- a/cli/tests/testdata/coverage/no_tests_included/foo.test.ts +++ b/cli/tests/testdata/coverage/no_tests_included/foo.test.ts @@ -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); diff --git a/cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov b/cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov index 480945d142daad..fae96ed355d539 100644 --- a/cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov +++ b/cli/tests/testdata/coverage/no_transpiled_lines/expected.lcov @@ -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 diff --git a/cli/tests/testdata/coverage/no_transpiled_lines/expected.out b/cli/tests/testdata/coverage/no_transpiled_lines/expected.out index 3438a045c45dc8..792bd654f66104 100644 --- a/cli/tests/testdata/coverage/no_transpiled_lines/expected.out +++ b/cli/tests/testdata/coverage/no_transpiled_lines/expected.out @@ -1 +1 @@ -cover [WILDCARD]index.ts ... 100.000% (2/2) +cover [WILDCARD]index.ts ... 100.000% (4/4) diff --git a/cli/tests/testdata/coverage/no_transpiled_lines/index.ts b/cli/tests/testdata/coverage/no_transpiled_lines/index.ts index 7e4f22163570de..df25283cd3e989 100644 --- a/cli/tests/testdata/coverage/no_transpiled_lines/index.ts +++ b/cli/tests/testdata/coverage/no_transpiled_lines/index.ts @@ -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"; diff --git a/cli/tests/testdata/run/045_proxy_test.ts b/cli/tests/testdata/run/045_proxy_test.ts index eacce1130cffac..8ca733a942cee1 100644 --- a/cli/tests/testdata/run/045_proxy_test.ts +++ b/cli/tests/testdata/run/045_proxy_test.ts @@ -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"; diff --git a/cli/tests/testdata/run/import_meta/main.ts b/cli/tests/testdata/run/import_meta/main.ts index b6d9c506ecc46a..0d7cb96daef64d 100644 --- a/cli/tests/testdata/run/import_meta/main.ts +++ b/cli/tests/testdata/run/import_meta/main.ts @@ -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); diff --git a/cli/tests/testdata/run/onload/imported.ts b/cli/tests/testdata/run/onload/imported.ts index 971ddaea351676..f4157b86f8309f 100644 --- a/cli/tests/testdata/run/onload/imported.ts +++ b/cli/tests/testdata/run/onload/imported.ts @@ -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) => { diff --git a/cli/tests/testdata/run/onload/main.ts b/cli/tests/testdata/run/onload/main.ts index 191c4d872879fd..126627e34faaa6 100644 --- a/cli/tests/testdata/run/onload/main.ts +++ b/cli/tests/testdata/run/onload/main.ts @@ -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")); diff --git a/cli/tests/testdata/run/onload/nest_imported.ts b/cli/tests/testdata/run/onload/nest_imported.ts index e8969985491273..a942d272954e2a 100644 --- a/cli/tests/testdata/run/onload/nest_imported.ts +++ b/cli/tests/testdata/run/onload/nest_imported.ts @@ -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); diff --git a/cli/tests/testdata/run/tls_connecttls.js b/cli/tests/testdata/run/tls_connecttls.js index 1fcf6640a8310b..7c03856cb7985d 100644 --- a/cli/tests/testdata/run/tls_connecttls.js +++ b/cli/tests/testdata/run/tls_connecttls.js @@ -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"; diff --git a/cli/tests/testdata/run/tls_starttls.js b/cli/tests/testdata/run/tls_starttls.js index 34b97a4cbce5f5..ecf344211be33e 100644 --- a/cli/tests/testdata/run/tls_starttls.js +++ b/cli/tests/testdata/run/tls_starttls.js @@ -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"; diff --git a/cli/tests/testdata/run/websocket_server_idletimeout.ts b/cli/tests/testdata/run/websocket_server_idletimeout.ts index e7bfd733728bf3..211b5f6ea9e44a 100644 --- a/cli/tests/testdata/run/websocket_server_idletimeout.ts +++ b/cli/tests/testdata/run/websocket_server_idletimeout.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(); diff --git a/cli/tests/testdata/run/websocket_test.ts b/cli/tests/testdata/run/websocket_test.ts index 924738abe28087..d80f03c92aa126 100644 --- a/cli/tests/testdata/run/websocket_test.ts +++ b/cli/tests/testdata/run/websocket_test.ts @@ -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", () => { diff --git a/cli/tests/testdata/run/websocketstream_test.ts b/cli/tests/testdata/run/websocketstream_test.ts index f34eaf0ab9b503..82dd59a20e45e0 100644 --- a/cli/tests/testdata/run/websocketstream_test.ts +++ b/cli/tests/testdata/run/websocketstream_test.ts @@ -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/#")); diff --git a/cli/tests/testdata/test/allow_all.ts b/cli/tests/testdata/test/allow_all.ts index 50cd407e41a28b..c7a2381300e8c8 100644 --- a/cli/tests/testdata/test/allow_all.ts +++ b/cli/tests/testdata/test/allow_all.ts @@ -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", diff --git a/cli/tests/testdata/test/allow_none.ts b/cli/tests/testdata/test/allow_none.ts index eb760242a4ea71..3153b97553d707 100644 --- a/cli/tests/testdata/test/allow_none.ts +++ b/cli/tests/testdata/test/allow_none.ts @@ -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", diff --git a/cli/tests/testdata/workers/deno_worker.ts b/cli/tests/testdata/workers/deno_worker.ts index eccdab5b0b7de7..a4dca150686ac1 100644 --- a/cli/tests/testdata/workers/deno_worker.ts +++ b/cli/tests/testdata/workers/deno_worker.ts @@ -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") { diff --git a/cli/tests/testdata/workers/test.ts b/cli/tests/testdata/workers/test.ts index 6892ed85aa46e7..0ea9a74772b72c 100644 --- a/cli/tests/testdata/workers/test.ts +++ b/cli/tests/testdata/workers/test.ts @@ -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({ diff --git a/cli/tests/unit/broadcast_channel_test.ts b/cli/tests/unit/broadcast_channel_test.ts index f18934278719c3..b13a4757489817 100644 --- a/cli/tests/unit/broadcast_channel_test.ts +++ b/cli/tests/unit/broadcast_channel_test.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 { deferred } from "../../../test_util/std/async/deferred.ts"; Deno.test("BroadcastChannel worker", async () => { diff --git a/cli/tests/unit/message_channel_test.ts b/cli/tests/unit/message_channel_test.ts index a3fc94c79a49ca..35b7c47c40700b 100644 --- a/cli/tests/unit/message_channel_test.ts +++ b/cli/tests/unit/message_channel_test.ts @@ -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 () => { diff --git a/cli/tests/unit/opcall_test.ts b/cli/tests/unit/opcall_test.ts index d2c65440c7dca6..fb269fc3239359 100644 --- a/cli/tests/unit/opcall_test.ts +++ b/cli/tests/unit/opcall_test.ts @@ -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() { diff --git a/cli/tests/unit/serve_test.ts b/cli/tests/unit/serve_test.ts index 49f8c1f2dad9d6..2e560af9957f3b 100644 --- a/cli/tests/unit/serve_test.ts +++ b/cli/tests/unit/serve_test.ts @@ -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 { diff --git a/cli/tests/unit/test_util.ts b/cli/tests/unit/test_util.ts index 2061f859e86f03..de1e8e8c5d1e5b 100644 --- a/cli/tests/unit/test_util.ts +++ b/cli/tests/unit/test_util.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_access_test.ts b/cli/tests/unit_node/_fs/_fs_access_test.ts index 15fa2410f74f4b..5fd2a5b31dcbb4 100644 --- a/cli/tests/unit_node/_fs/_fs_access_test.ts +++ b/cli/tests/unit_node/_fs/_fs_access_test.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", diff --git a/cli/tests/unit_node/_fs/_fs_appendFile_test.ts b/cli/tests/unit_node/_fs/_fs_appendFile_test.ts index 37701593459376..5741938f0659c9 100644 --- a/cli/tests/unit_node/_fs/_fs_appendFile_test.ts +++ b/cli/tests/unit_node/_fs/_fs_appendFile_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_chmod_test.ts b/cli/tests/unit_node/_fs/_fs_chmod_test.ts index 4704f612fd130e..11f01d1ad6e5dc 100644 --- a/cli/tests/unit_node/_fs/_fs_chmod_test.ts +++ b/cli/tests/unit_node/_fs/_fs_chmod_test.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"; diff --git a/cli/tests/unit_node/_fs/_fs_chown_test.ts b/cli/tests/unit_node/_fs/_fs_chown_test.ts index 4fd2d6c8c8b472..2174d49d718fa7 100644 --- a/cli/tests/unit_node/_fs/_fs_chown_test.ts +++ b/cli/tests/unit_node/_fs/_fs_chown_test.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 { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { chown, chownSync } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_close_test.ts b/cli/tests/unit_node/_fs/_fs_close_test.ts index d14ad1b73cc344..4d0743dbd7b19d 100644 --- a/cli/tests/unit_node/_fs/_fs_close_test.ts +++ b/cli/tests/unit_node/_fs/_fs_close_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_copy_test.ts b/cli/tests/unit_node/_fs/_fs_copy_test.ts index cea6e65ab7424f..b08e8d7f3d7dee 100644 --- a/cli/tests/unit_node/_fs/_fs_copy_test.ts +++ b/cli/tests/unit_node/_fs/_fs_copy_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_dir_test.ts b/cli/tests/unit_node/_fs/_fs_dir_test.ts index eb8a0073b27011..7f53ee1d36c641 100644 --- a/cli/tests/unit_node/_fs/_fs_dir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_dir_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_dirent_test.ts b/cli/tests/unit_node/_fs/_fs_dirent_test.ts index 8a3f066ea254ca..eca693f6fb6b5f 100644 --- a/cli/tests/unit_node/_fs/_fs_dirent_test.ts +++ b/cli/tests/unit_node/_fs/_fs_dirent_test.ts @@ -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 diff --git a/cli/tests/unit_node/_fs/_fs_exists_test.ts b/cli/tests/unit_node/_fs/_fs_exists_test.ts index 49dad173df0945..9af5b32081d792 100644 --- a/cli/tests/unit_node/_fs/_fs_exists_test.ts +++ b/cli/tests/unit_node/_fs/_fs_exists_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts b/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts index 6253dffffa6d5c..d7ccae927fdee0 100644 --- a/cli/tests/unit_node/_fs/_fs_fdatasync_test.ts +++ b/cli/tests/unit_node/_fs/_fs_fdatasync_test.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 { fdatasync, fdatasyncSync } from "node:fs"; Deno.test({ diff --git a/cli/tests/unit_node/_fs/_fs_fstat_test.ts b/cli/tests/unit_node/_fs/_fs_fstat_test.ts index fe578aa5142802..70c3db254ad4db 100644 --- a/cli/tests/unit_node/_fs/_fs_fstat_test.ts +++ b/cli/tests/unit_node/_fs/_fs_fstat_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_fsync_test.ts b/cli/tests/unit_node/_fs/_fs_fsync_test.ts index 0d055fdcebdffa..586c7d7e6cb3c2 100644 --- a/cli/tests/unit_node/_fs/_fs_fsync_test.ts +++ b/cli/tests/unit_node/_fs/_fs_fsync_test.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 { fsync, fsyncSync } from "node:fs"; Deno.test({ diff --git a/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts b/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts index 67bc8262e19548..46787bec133fe0 100644 --- a/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts +++ b/cli/tests/unit_node/_fs/_fs_ftruncate_test.ts @@ -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({ diff --git a/cli/tests/unit_node/_fs/_fs_futimes_test.ts b/cli/tests/unit_node/_fs/_fs_futimes_test.ts index 3b76807ffbb316..c5b9012a53ff8f 100644 --- a/cli/tests/unit_node/_fs/_fs_futimes_test.ts +++ b/cli/tests/unit_node/_fs/_fs_futimes_test.ts @@ -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); diff --git a/cli/tests/unit_node/_fs/_fs_handle_test.ts b/cli/tests/unit_node/_fs/_fs_handle_test.ts index 2322068607470f..8cfbf64906d072 100644 --- a/cli/tests/unit_node/_fs/_fs_handle_test.ts +++ b/cli/tests/unit_node/_fs/_fs_handle_test.ts @@ -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"); diff --git a/cli/tests/unit_node/_fs/_fs_link_test.ts b/cli/tests/unit_node/_fs/_fs_link_test.ts index 3594b56fe1ac01..a96457eb06850e 100644 --- a/cli/tests/unit_node/_fs/_fs_link_test.ts +++ b/cli/tests/unit_node/_fs/_fs_link_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_lstat_test.ts b/cli/tests/unit_node/_fs/_fs_lstat_test.ts index c09f840eb2ae9c..cd11279898e61b 100644 --- a/cli/tests/unit_node/_fs/_fs_lstat_test.ts +++ b/cli/tests/unit_node/_fs/_fs_lstat_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_mkdir_test.ts b/cli/tests/unit_node/_fs/_fs_mkdir_test.ts index b55ffd4a45f212..0deae9276d8897 100644 --- a/cli/tests/unit_node/_fs/_fs_mkdir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_mkdir_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts b/cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts index e1e2c148e68380..998128596d6da6 100644 --- a/cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts +++ b/cli/tests/unit_node/_fs/_fs_mkdtemp_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_open_test.ts b/cli/tests/unit_node/_fs/_fs_open_test.ts index f7a7192b8ae38d..d9f5e57963457c 100644 --- a/cli/tests/unit_node/_fs/_fs_open_test.ts +++ b/cli/tests/unit_node/_fs/_fs_open_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_opendir_test.ts b/cli/tests/unit_node/_fs/_fs_opendir_test.ts index 5219643f21b41c..196bea7778bb65 100644 --- a/cli/tests/unit_node/_fs/_fs_opendir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_opendir_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_readFile_test.ts b/cli/tests/unit_node/_fs/_fs_readFile_test.ts index 335a7cfc76be0e..8fa9e7b010ce6c 100644 --- a/cli/tests/unit_node/_fs/_fs_readFile_test.ts +++ b/cli/tests/unit_node/_fs/_fs_readFile_test.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"); diff --git a/cli/tests/unit_node/_fs/_fs_read_test.ts b/cli/tests/unit_node/_fs/_fs_read_test.ts index 547ba7874dfc18..34b029d9faf493 100644 --- a/cli/tests/unit_node/_fs/_fs_read_test.ts +++ b/cli/tests/unit_node/_fs/_fs_read_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_readdir_test.ts b/cli/tests/unit_node/_fs/_fs_readdir_test.ts index b2ec353c548df3..bb1df079f9e980 100644 --- a/cli/tests/unit_node/_fs/_fs_readdir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_readdir_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_readlink_test.ts b/cli/tests/unit_node/_fs/_fs_readlink_test.ts index 0d134023bf1cf8..7f0d3cef83ad10 100644 --- a/cli/tests/unit_node/_fs/_fs_readlink_test.ts +++ b/cli/tests/unit_node/_fs/_fs_readlink_test.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(); diff --git a/cli/tests/unit_node/_fs/_fs_realpath_test.ts b/cli/tests/unit_node/_fs/_fs_realpath_test.ts index df7fb8da347d97..871ebe9836e54b 100644 --- a/cli/tests/unit_node/_fs/_fs_realpath_test.ts +++ b/cli/tests/unit_node/_fs/_fs_realpath_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_rename_test.ts b/cli/tests/unit_node/_fs/_fs_rename_test.ts index 8310cdb58aab5c..cefd7f61ad7755 100644 --- a/cli/tests/unit_node/_fs/_fs_rename_test.ts +++ b/cli/tests/unit_node/_fs/_fs_rename_test.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 { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { rename, renameSync } from "node:fs"; import { existsSync } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_rm_test.ts b/cli/tests/unit_node/_fs/_fs_rm_test.ts index cb4ae1aa165b61..e196ee08a94bf5 100644 --- a/cli/tests/unit_node/_fs/_fs_rm_test.ts +++ b/cli/tests/unit_node/_fs/_fs_rm_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_rmdir_test.ts b/cli/tests/unit_node/_fs/_fs_rmdir_test.ts index 7bbae6270cba09..85aaa2ec37eaa8 100644 --- a/cli/tests/unit_node/_fs/_fs_rmdir_test.ts +++ b/cli/tests/unit_node/_fs/_fs_rmdir_test.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"; diff --git a/cli/tests/unit_node/_fs/_fs_stat_test.ts b/cli/tests/unit_node/_fs/_fs_stat_test.ts index 776d89ecc6ef51..b9e33c5074af65 100644 --- a/cli/tests/unit_node/_fs/_fs_stat_test.ts +++ b/cli/tests/unit_node/_fs/_fs_stat_test.ts @@ -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); diff --git a/cli/tests/unit_node/_fs/_fs_symlink_test.ts b/cli/tests/unit_node/_fs/_fs_symlink_test.ts index f16188feec9499..72747ebfaafa4d 100644 --- a/cli/tests/unit_node/_fs/_fs_symlink_test.ts +++ b/cli/tests/unit_node/_fs/_fs_symlink_test.ts @@ -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({ diff --git a/cli/tests/unit_node/_fs/_fs_truncate_test.ts b/cli/tests/unit_node/_fs/_fs_truncate_test.ts index 98fb6c5f0ad9ca..3aff3fac27108a 100644 --- a/cli/tests/unit_node/_fs/_fs_truncate_test.ts +++ b/cli/tests/unit_node/_fs/_fs_truncate_test.ts @@ -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({ diff --git a/cli/tests/unit_node/_fs/_fs_unlink_test.ts b/cli/tests/unit_node/_fs/_fs_unlink_test.ts index b92224844b0717..a33534fbb605fe 100644 --- a/cli/tests/unit_node/_fs/_fs_unlink_test.ts +++ b/cli/tests/unit_node/_fs/_fs_unlink_test.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 { existsSync } from "node:fs"; import { assertCallbackErrorUncaught } from "../_test_utils.ts"; import { unlink, unlinkSync } from "node:fs"; diff --git a/cli/tests/unit_node/_fs/_fs_utimes_test.ts b/cli/tests/unit_node/_fs/_fs_utimes_test.ts index a2d3e605c1d5ae..170c0d73d8b70a 100644 --- a/cli/tests/unit_node/_fs/_fs_utimes_test.ts +++ b/cli/tests/unit_node/_fs/_fs_utimes_test.ts @@ -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); diff --git a/cli/tests/unit_node/_fs/_fs_watch_test.ts b/cli/tests/unit_node/_fs/_fs_watch_test.ts index 9163435994ef1f..26b0da8b9749ee 100644 --- a/cli/tests/unit_node/_fs/_fs_watch_test.ts +++ b/cli/tests/unit_node/_fs/_fs_watch_test.ts @@ -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) => { diff --git a/cli/tests/unit_node/_fs/_fs_writeFile_test.ts b/cli/tests/unit_node/_fs/_fs_writeFile_test.ts index b96f4d29b5cfe0..9f123e005c236d 100644 --- a/cli/tests/unit_node/_fs/_fs_writeFile_test.ts +++ b/cli/tests/unit_node/_fs/_fs_writeFile_test.ts @@ -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"; diff --git a/cli/tests/unit_node/_fs/_fs_write_test.ts b/cli/tests/unit_node/_fs/_fs_write_test.ts index afc15f29ff5685..7baa81b7df7b92 100644 --- a/cli/tests/unit_node/_fs/_fs_write_test.ts +++ b/cli/tests/unit_node/_fs/_fs_write_test.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"); diff --git a/cli/tests/unit_node/_test_utils.ts b/cli/tests/unit_node/_test_utils.ts index 514818bced8de4..322067719868eb 100644 --- a/cli/tests/unit_node/_test_utils.ts +++ b/cli/tests/unit_node/_test_utils.ts @@ -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( diff --git a/cli/tests/unit_node/assertion_error_test.ts b/cli/tests/unit_node/assertion_error_test.ts index ac0636942240b6..ab6ed5bc3bc9fd 100644 --- a/cli/tests/unit_node/assertion_error_test.ts +++ b/cli/tests/unit_node/assertion_error_test.ts @@ -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({ diff --git a/cli/tests/unit_node/async_hooks_test.ts b/cli/tests/unit_node/async_hooks_test.ts index adaa28593220a5..871ad85f97ca79 100644 --- a/cli/tests/unit_node/async_hooks_test.ts +++ b/cli/tests/unit_node/async_hooks_test.ts @@ -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() { diff --git a/cli/tests/unit_node/buffer_test.ts b/cli/tests/unit_node/buffer_test.ts index cfd1bf748d8b00..5244764c65a24d 100644 --- a/cli/tests/unit_node/buffer_test.ts +++ b/cli/tests/unit_node/buffer_test.ts @@ -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", diff --git a/cli/tests/unit_node/child_process_test.ts b/cli/tests/unit_node/child_process_test.ts index aa053060ae1fc2..8d1c9a6b7394fe 100644 --- a/cli/tests/unit_node/child_process_test.ts +++ b/cli/tests/unit_node/child_process_test.ts @@ -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"; diff --git a/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts b/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts index 2ed9c1d87bbc2e..e1ef440581f367 100644 --- a/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.ts +++ b/cli/tests/unit_node/crypto/crypto_cipher_gcm_test.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`; diff --git a/cli/tests/unit_node/crypto/crypto_cipher_test.ts b/cli/tests/unit_node/crypto/crypto_cipher_test.ts index 52a9b06ec7a2cb..0eecaacf062d15 100644 --- a/cli/tests/unit_node/crypto/crypto_cipher_test.ts +++ b/cli/tests/unit_node/crypto/crypto_cipher_test.ts @@ -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), diff --git a/cli/tests/unit_node/crypto/crypto_hash_test.ts b/cli/tests/unit_node/crypto/crypto_hash_test.ts index 3167628ceea456..4b0aedf039bd5f 100644 --- a/cli/tests/unit_node/crypto/crypto_hash_test.ts +++ b/cli/tests/unit_node/crypto/crypto_hash_test.ts @@ -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({ diff --git a/cli/tests/unit_node/crypto/crypto_key_test.ts b/cli/tests/unit_node/crypto/crypto_key_test.ts index a91461969990dc..672c9fa7f06788 100644 --- a/cli/tests/unit_node/crypto/crypto_key_test.ts +++ b/cli/tests/unit_node/crypto/crypto_key_test.ts @@ -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( diff --git a/cli/tests/unit_node/crypto/crypto_sign_test.ts b/cli/tests/unit_node/crypto/crypto_sign_test.ts index 58107b563ac482..9988ed71c3e811 100644 --- a/cli/tests/unit_node/crypto/crypto_sign_test.ts +++ b/cli/tests/unit_node/crypto/crypto_sign_test.ts @@ -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"; diff --git a/cli/tests/unit_node/fs_test.ts b/cli/tests/unit_node/fs_test.ts index 310113233e03de..3e9ad44802f04d 100644 --- a/cli/tests/unit_node/fs_test.ts +++ b/cli/tests/unit_node/fs_test.ts @@ -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"; diff --git a/cli/tests/unit_node/http2_test.ts b/cli/tests/unit_node/http2_test.ts index aa17c81fc99ae3..d0e0de43f1e90c 100644 --- a/cli/tests/unit_node/http2_test.ts +++ b/cli/tests/unit_node/http2_test.ts @@ -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}`, { diff --git a/cli/tests/unit_node/http_test.ts b/cli/tests/unit_node/http_test.ts index 07b7d0e20fec88..825815ae646ae9 100644 --- a/cli/tests/unit_node/http_test.ts +++ b/cli/tests/unit_node/http_test.ts @@ -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"; diff --git a/cli/tests/unit_node/internal/_randomBytes_test.ts b/cli/tests/unit_node/internal/_randomBytes_test.ts index 69845705e8916f..1072ce164b432c 100644 --- a/cli/tests/unit_node/internal/_randomBytes_test.ts +++ b/cli/tests/unit_node/internal/_randomBytes_test.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"; diff --git a/cli/tests/unit_node/internal/_randomFill_test.ts b/cli/tests/unit_node/internal/_randomFill_test.ts index 537a11e5efe1f6..5e2e154c8e6ff9 100644 --- a/cli/tests/unit_node/internal/_randomFill_test.ts +++ b/cli/tests/unit_node/internal/_randomFill_test.ts @@ -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) => { diff --git a/cli/tests/unit_node/internal/_randomInt_test.ts b/cli/tests/unit_node/internal/_randomInt_test.ts index 36d8a2146a0d41..4bed13498eb75a 100644 --- a/cli/tests/unit_node/internal/_randomInt_test.ts +++ b/cli/tests/unit_node/internal/_randomInt_test.ts @@ -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; diff --git a/cli/tests/unit_node/internal/pbkdf2_test.ts b/cli/tests/unit_node/internal/pbkdf2_test.ts index 79c379d9a2af45..3d3378769d560e 100644 --- a/cli/tests/unit_node/internal/pbkdf2_test.ts +++ b/cli/tests/unit_node/internal/pbkdf2_test.ts @@ -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" diff --git a/cli/tests/unit_node/internal/scrypt_test.ts b/cli/tests/unit_node/internal/scrypt_test.ts index 6081df5f32e8f1..d65cd27fffbdcb 100644 --- a/cli/tests/unit_node/internal/scrypt_test.ts +++ b/cli/tests/unit_node/internal/scrypt_test.ts @@ -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 () => { diff --git a/cli/tests/unit_node/module_test.ts b/cli/tests/unit_node/module_test.ts index 8ecef7fa40c7ee..9818f4766cdeb2 100644 --- a/cli/tests/unit_node/module_test.ts +++ b/cli/tests/unit_node/module_test.ts @@ -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"; diff --git a/cli/tests/unit_node/net_test.ts b/cli/tests/unit_node/net_test.ts index 9567defe6e7838..ca9d214e191181 100644 --- a/cli/tests/unit_node/net_test.ts +++ b/cli/tests/unit_node/net_test.ts @@ -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"; diff --git a/cli/tests/unit_node/os_test.ts b/cli/tests/unit_node/os_test.ts index 48e241027d9749..2d0d3a8c80dfc3 100644 --- a/cli/tests/unit_node/os_test.ts +++ b/cli/tests/unit_node/os_test.ts @@ -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", diff --git a/cli/tests/unit_node/path_test.ts b/cli/tests/unit_node/path_test.ts index 8b1af9ee19fc34..48298afec3a97c 100644 --- a/cli/tests/unit_node/path_test.ts +++ b/cli/tests/unit_node/path_test.ts @@ -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); diff --git a/cli/tests/unit_node/perf_hooks_test.ts b/cli/tests/unit_node/perf_hooks_test.ts index 2866f0d40491ff..2249e62f8244e8 100644 --- a/cli/tests/unit_node/perf_hooks_test.ts +++ b/cli/tests/unit_node/perf_hooks_test.ts @@ -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", diff --git a/cli/tests/unit_node/process_test.ts b/cli/tests/unit_node/process_test.ts index eeac1b67f3cc75..1f4638b91e44b4 100644 --- a/cli/tests/unit_node/process_test.ts +++ b/cli/tests/unit_node/process_test.ts @@ -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"; diff --git a/cli/tests/unit_node/querystring_test.ts b/cli/tests/unit_node/querystring_test.ts index bd5548223ec6f3..0b3b22d62d6aa2 100644 --- a/cli/tests/unit_node/querystring_test.ts +++ b/cli/tests/unit_node/querystring_test.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({ diff --git a/cli/tests/unit_node/readline_test.ts b/cli/tests/unit_node/readline_test.ts index 8978b53ff56213..914d23e4aff5db 100644 --- a/cli/tests/unit_node/readline_test.ts +++ b/cli/tests/unit_node/readline_test.ts @@ -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", () => { diff --git a/cli/tests/unit_node/repl_test.ts b/cli/tests/unit_node/repl_test.ts index 9df8d03757965c..e703d69f8b9873 100644 --- a/cli/tests/unit_node/repl_test.ts +++ b/cli/tests/unit_node/repl_test.ts @@ -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", diff --git a/cli/tests/unit_node/stream_test.ts b/cli/tests/unit_node/stream_test.ts index 9d3d3df082a6ea..058d3ca7c6e412 100644 --- a/cli/tests/unit_node/stream_test.ts +++ b/cli/tests/unit_node/stream_test.ts @@ -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"; diff --git a/cli/tests/unit_node/string_decoder_test.ts b/cli/tests/unit_node/string_decoder_test.ts index facd4cc4ec4a40..93ff69dc326747 100644 --- a/cli/tests/unit_node/string_decoder_test.ts +++ b/cli/tests/unit_node/string_decoder_test.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 { Buffer } from "node:buffer"; import { StringDecoder } from "node:string_decoder"; diff --git a/cli/tests/unit_node/timers_test.ts b/cli/tests/unit_node/timers_test.ts index f6c8f7773efeb1..d110b44e4577fe 100644 --- a/cli/tests/unit_node/timers_test.ts +++ b/cli/tests/unit_node/timers_test.ts @@ -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"; diff --git a/cli/tests/unit_node/tls_test.ts b/cli/tests/unit_node/tls_test.ts index aeb7cf5eaec9c4..7a270c60b3fa4d 100644 --- a/cli/tests/unit_node/tls_test.ts +++ b/cli/tests/unit_node/tls_test.ts @@ -3,7 +3,7 @@ import { assertEquals, assertInstanceOf, -} from "../../../test_util/std/assert/mod.ts"; +} from "../../../test_util/std/testing/asserts.ts"; import { delay } from "../../../test_util/std/async/delay.ts"; import { deferred } from "../../../test_util/std/async/deferred.ts"; import { fromFileUrl, join } from "../../../test_util/std/path/mod.ts"; diff --git a/cli/tests/unit_node/tty_test.ts b/cli/tests/unit_node/tty_test.ts index 930f1aaffacbc3..d2bf32efcbea80 100644 --- a/cli/tests/unit_node/tty_test.ts +++ b/cli/tests/unit_node/tty_test.ts @@ -1,7 +1,7 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. // deno-lint-ignore-file no-explicit-any -import { assert } from "../../../test_util/std/assert/mod.ts"; +import { assert } from "../../../test_util/std/testing/asserts.ts"; import { isatty } from "node:tty"; Deno.test("[node/tty isatty] returns true when fd is a tty, false otherwise", () => { diff --git a/cli/tests/unit_node/util_test.ts b/cli/tests/unit_node/util_test.ts index 87d59019ffc48c..81794c856ff4c2 100644 --- a/cli/tests/unit_node/util_test.ts +++ b/cli/tests/unit_node/util_test.ts @@ -5,7 +5,7 @@ import { assertEquals, 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 * as util from "node:util"; diff --git a/cli/tests/unit_node/v8_test.ts b/cli/tests/unit_node/v8_test.ts index 8eb67701e5bc65..724ac35044db0e 100644 --- a/cli/tests/unit_node/v8_test.ts +++ b/cli/tests/unit_node/v8_test.ts @@ -4,7 +4,7 @@ import { getHeapStatistics, setFlagsFromString, } from "node:v8"; -import { assertEquals } from "../../../test_util/std/assert/mod.ts"; +import { assertEquals } from "../../../test_util/std/testing/asserts.ts"; // https://github.com/nodejs/node/blob/a2bbe5ff216bc28f8dac1c36a8750025a93c3827/test/parallel/test-v8-version-tag.js#L6 Deno.test({ diff --git a/cli/tests/unit_node/worker_threads_test.ts b/cli/tests/unit_node/worker_threads_test.ts index 0271995e644a70..a43a1b50600b11 100644 --- a/cli/tests/unit_node/worker_threads_test.ts +++ b/cli/tests/unit_node/worker_threads_test.ts @@ -4,7 +4,7 @@ import { assert, assertEquals, assertObjectMatch, -} from "../../../test_util/std/assert/mod.ts"; +} from "../../../test_util/std/testing/asserts.ts"; import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts"; import * as workerThreads from "node:worker_threads"; import { EventEmitter, once } from "node:events"; diff --git a/cli/tests/unit_node/zlib_test.ts b/cli/tests/unit_node/zlib_test.ts index 50bf7f11a4e0a2..b878b7cc3294e5 100644 --- a/cli/tests/unit_node/zlib_test.ts +++ b/cli/tests/unit_node/zlib_test.ts @@ -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 { deferred } from "../../../test_util/std/async/deferred.ts"; import { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts"; import { diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 0968ba3a0a05c5..e51e9736a9e5c7 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -544,7 +544,7 @@ declare namespace Deno { * Examples: * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test({ * name: "inherit", @@ -559,7 +559,7 @@ declare namespace Deno { * ``` * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test({ * name: "true", @@ -574,7 +574,7 @@ declare namespace Deno { * ``` * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test({ * name: "false", @@ -589,7 +589,7 @@ declare namespace Deno { * ``` * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test({ * name: "localhost:8080", @@ -821,7 +821,7 @@ declare namespace Deno { * `fn` can be async if required. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test({ * name: "example test", @@ -858,7 +858,7 @@ declare namespace Deno { * `fn` can be async if required. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test("My test description", () => { * assertEquals("hello", "hello"); @@ -884,7 +884,7 @@ declare namespace Deno { * `fn` can be async if required. Declared function must have a name. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test(function myTestName() { * assertEquals("hello", "hello"); @@ -907,7 +907,7 @@ declare namespace Deno { * `fn` can be async if required. * * ```ts - * import {assert, fail, assertEquals} from "https://deno.land/std/assert/mod.ts"; + * import {assert, fail, assertEquals} from "https://deno.land/std/testing/asserts.ts"; * * Deno.test("My test description", { permissions: { read: true } }, (): void => { * assertEquals("hello", "hello"); @@ -934,7 +934,7 @@ declare namespace Deno { * `fn` can be async if required. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test( * { @@ -972,7 +972,7 @@ declare namespace Deno { * `fn` can be async if required. Declared function must have a name. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.test( * { permissions: { read: true } }, @@ -1196,7 +1196,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.bench({ * name: "example test", @@ -1235,7 +1235,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.bench("My test description", () => { * assertEquals("hello", "hello"); @@ -1263,7 +1263,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.bench(function myTestName() { * assertEquals("hello", "hello"); @@ -1288,7 +1288,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.bench( * "My test description", @@ -1325,7 +1325,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.bench( * { name: "My test description", permissions: { read: true } }, @@ -1359,7 +1359,7 @@ declare namespace Deno { * will await resolution to consider the test complete. * * ```ts - * import { assertEquals } from "https://deno.land/std/assert/mod.ts"; + * import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; * * Deno.bench( * { permissions: { read: true } }, @@ -2420,7 +2420,7 @@ declare namespace Deno { /** Resolves to a {@linkcode Deno.FileInfo} for the file. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * const file = await Deno.open("hello.txt"); * const fileInfo = await file.stat(); @@ -2432,7 +2432,7 @@ declare namespace Deno { /** Synchronously returns a {@linkcode Deno.FileInfo} for the file. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * const file = Deno.openSync("hello.txt") * const fileInfo = file.statSync(); @@ -3485,7 +3485,7 @@ declare namespace Deno { * of what it points to. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * const fileInfo = await Deno.lstat("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -3502,7 +3502,7 @@ declare namespace Deno { * returned instead of what it points to. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * const fileInfo = Deno.lstatSync("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -3518,7 +3518,7 @@ declare namespace Deno { * always follow symlinks. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * const fileInfo = await Deno.stat("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -3534,7 +3534,7 @@ declare namespace Deno { * `path`. Will always follow symlinks. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * const fileInfo = Deno.statSync("hello.txt"); * assert(fileInfo.isFile); * ``` @@ -4762,7 +4762,7 @@ declare namespace Deno { /** Revokes a permission, and resolves to the state of the permission. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * const status = await Deno.permissions.revoke({ name: "run" }); * assert(status.state !== "granted") @@ -4773,7 +4773,7 @@ declare namespace Deno { /** Revokes a permission, and returns the state of the permission. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * const status = Deno.permissions.revokeSync({ name: "run" }); * assert(status.state !== "granted") @@ -4851,14 +4851,14 @@ declare namespace Deno { * ### Revoking * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * const status = await Deno.permissions.revoke({ name: "run" }); * assert(status.state !== "granted") * ``` * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * const status = Deno.permissions.revokeSync({ name: "run" }); * assert(status.state !== "granted") @@ -5168,7 +5168,7 @@ declare namespace Deno { * Returns a `Deno.FileInfo` for the given file stream. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * const file = await Deno.open("file.txt", { read: true }); * const fileInfo = await Deno.fstat(file.rid); @@ -5184,7 +5184,7 @@ declare namespace Deno { * stream. * * ```ts - * import { assert } from "https://deno.land/std/assert/mod.ts"; + * import { assert } from "https://deno.land/std/testing/asserts.ts"; * * const file = Deno.openSync("file.txt", { read: true }); * const fileInfo = Deno.fstatSync(file.rid); diff --git a/test_ffi/tests/test.js b/test_ffi/tests/test.js index 62b23c36e65af0..80c5663980d456 100644 --- a/test_ffi/tests/test.js +++ b/test_ffi/tests/test.js @@ -10,7 +10,7 @@ import { assertInstanceOf, assertEquals, assertFalse, -} from "../../test_util/std/assert/mod.ts"; +} from "../../test_util/std/testing/asserts.ts"; const targetDir = Deno.execPath().replace(/[^\/\\]+$/, ""); const [libPrefix, libSuffix] = { diff --git a/test_napi/common.js b/test_napi/common.js index 6ed9c63a06a312..ede045666984bb 100644 --- a/test_napi/common.js +++ b/test_napi/common.js @@ -5,7 +5,7 @@ export { assertEquals, assertRejects, assertThrows, -} from "../test_util/std/assert/mod.ts"; +} from "../test_util/std/testing/asserts.ts"; export { fromFileUrl } from "../test_util/std/path/mod.ts"; import process from "node:process"; diff --git a/test_util/std b/test_util/std index 413dd7928ca770..b23a76a47adaf6 160000 --- a/test_util/std +++ b/test_util/std @@ -1 +1 @@ -Subproject commit 413dd7928ca77043f4d3dcd6d3abc64bbfab3cd2 +Subproject commit b23a76a47adaf63b5493761a87e6dd0dc0de0bb8 From e6ff84c9f90c7d151a7219ac6fa22d88ac2934fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 28 Oct 2023 03:54:52 +0200 Subject: [PATCH 06/10] chore: Remove 'UNSTABLE:' from 'deno compile' help (#21003) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bartek IwaƄczuk --- cli/args/flags.rs | 6 +++--- cli/tests/integration/flags_tests.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/args/flags.rs b/cli/args/flags.rs index 588f75dbbd427f..6e8b00cabc2d21 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1123,9 +1123,9 @@ Unless --reload is specified, this command will not re-download already cached d fn compile_subcommand() -> Command { Command::new("compile") - .about("UNSTABLE: Compile the script into a self contained executable") + .about("Compile the script into a self contained executable") .long_about( - "UNSTABLE: Compiles the given script into a self contained executable. + "Compiles the given script into a self contained executable. deno compile -A https://deno.land/std/http/file_server.ts deno compile --output color_util https://deno.land/std/examples/colors.ts @@ -1152,7 +1152,7 @@ supported in canary. .arg( Arg::new("include") .long("include") - .help("UNSTABLE: Additional module to include in the module graph") + .help("Additional module to include in the module graph") .long_help( "Includes an additional module in the compiled executable's module graph. Use this flag if a dynamically imported module or a web worker main diff --git a/cli/tests/integration/flags_tests.rs b/cli/tests/integration/flags_tests.rs index 55a83594b420a0..695283aca2ba3f 100644 --- a/cli/tests/integration/flags_tests.rs +++ b/cli/tests/integration/flags_tests.rs @@ -34,7 +34,7 @@ fn help_output() { "Bundle module and dependencies into single file", "Cache the dependencies", "Type-check the dependencies", - "UNSTABLE: Compile the script into a self contained executable", + "Compile the script into a self contained executable", "Generate shell completions", "Print coverage reports", "Show documentation for a module", From daf9756127a92f6682c4fdbc7d7047eb3a1586b6 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Fri, 27 Oct 2023 23:15:00 -0400 Subject: [PATCH 07/10] feat(task): add `head` command (#20998) Adds a built-in `head` command to deno task: https://github.com/denoland/deno_task_shell/pull/93 --- Cargo.lock | 58 +++++++++++++++++++++++++------------------------- cli/Cargo.toml | 2 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 75890118418d35..a9b0716142d416 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1050,7 +1050,7 @@ dependencies = [ "text_lines", "thiserror", "tokio", - "tokio-util 0.7.9", + "tokio-util 0.7.10", "tower-lsp", "trust-dns-client", "trust-dns-server", @@ -1312,7 +1312,7 @@ dependencies = [ "reqwest", "serde", "tokio", - "tokio-util 0.7.9", + "tokio-util 0.7.10", ] [[package]] @@ -1407,7 +1407,7 @@ dependencies = [ "smallvec", "thiserror", "tokio", - "tokio-util 0.7.9", + "tokio-util 0.7.10", ] [[package]] @@ -1683,9 +1683,9 @@ dependencies = [ [[package]] name = "deno_task_shell" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dbbad0a7ba06a961df3cd638ab117f5d67787607f627defa65629a4ef29d576" +checksum = "a94a6fd5d889087748f4794887f28756a01b718dae92a316db0951222231325a" dependencies = [ "anyhow", "futures", @@ -1694,7 +1694,7 @@ dependencies = [ "os_pipe", "path-dedot", "tokio", - "tokio-util 0.7.9", + "tokio-util 0.7.10", ] [[package]] @@ -2441,9 +2441,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -2456,9 +2456,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -2466,15 +2466,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -2483,15 +2483,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2 1.0.67", "quote 1.0.33", @@ -2500,21 +2500,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -2648,7 +2648,7 @@ dependencies = [ "indexmap 1.9.3", "slab", "tokio", - "tokio-util 0.7.9", + "tokio-util 0.7.10", "tracing", ] @@ -4340,7 +4340,7 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-socks", - "tokio-util 0.7.9", + "tokio-util 0.7.10", "tower-service", "url", "wasm-bindgen", @@ -5868,9 +5868,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -5943,7 +5943,7 @@ dependencies = [ "serde", "serde_json", "tokio", - "tokio-util 0.7.9", + "tokio-util 0.7.10", "tower", "tower-lsp-macros", "tracing", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 5f540625439702..bae8c4ab0f7b4c 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -57,7 +57,7 @@ deno_lockfile.workspace = true deno_npm = "0.15.2" deno_runtime = { workspace = true, features = ["dont_create_runtime_snapshot", "exclude_runtime_main_js", "include_js_files_for_snapshotting"] } deno_semver = "0.5.1" -deno_task_shell = "=0.13.2" +deno_task_shell = "=0.14.0" eszip = "=0.55.2" napi_sym.workspace = true From 5b2d9fb8d4f13e6383a5eceb2227305445416298 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sat, 28 Oct 2023 00:02:57 -0700 Subject: [PATCH 08/10] fix(ext/ffi): use anybuffer for op_ffi_buf_copy_into (#21006) Fixes https://github.com/denoland/deno/issues/21005 --- ext/ffi/repr.rs | 2 +- test_ffi/tests/test.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/ffi/repr.rs b/ext/ffi/repr.rs index 201df343e05559..426affdb578efc 100644 --- a/ext/ffi/repr.rs +++ b/ext/ffi/repr.rs @@ -177,7 +177,7 @@ pub fn op_ffi_buf_copy_into( state: &mut OpState, src: *mut c_void, #[number] offset: isize, - #[buffer] dst: &mut [u8], + #[anybuffer] dst: &mut [u8], #[number] len: usize, ) -> Result<(), AnyError> where diff --git a/test_ffi/tests/test.js b/test_ffi/tests/test.js index 80c5663980d456..cb0ea71abbecbd 100644 --- a/test_ffi/tests/test.js +++ b/test_ffi/tests/test.js @@ -327,6 +327,8 @@ const into2 = new Uint8Array(3); const into2ptr = Deno.UnsafePointer.of(into2); const into2ptrView = new Deno.UnsafePointerView(into2ptr); const into3 = new Uint8Array(3); +const into4 = new Uint16Array(3); +ptrView.copyInto(into4); ptrView.copyInto(into); console.log([...into]); ptrView.copyInto(into2, 3); From 857e0841c0f681efe5f03c47bd2b6da805e04f34 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sat, 28 Oct 2023 06:10:17 -0700 Subject: [PATCH 09/10] chore: bump quick-junit to 0.3.5 (#21004) Towards #20996 --- Cargo.lock | 82 +++++++++++++++++++++++++++----------------------- cli/Cargo.toml | 2 +- 2 files changed, 46 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a9b0716142d416..e322d63d16cc2b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -555,10 +555,8 @@ checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", "windows-targets", ] @@ -937,7 +935,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.14.0", + "hashbrown 0.14.2", "lock_api", "once_cell", "parking_lot_core 0.9.8", @@ -962,7 +960,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" dependencies = [ "serde", - "uuid 1.4.1", + "uuid 1.5.0", ] [[package]] @@ -1017,7 +1015,7 @@ dependencies = [ "hyper 0.14.27", "import_map", "indexmap 1.9.3", - "indexmap 2.0.0", + "indexmap 2.0.2", "jsonc-parser", "junction", "lazy-regex", @@ -1056,7 +1054,7 @@ dependencies = [ "trust-dns-server", "twox-hash", "typed-arena", - "uuid 1.4.1", + "uuid 1.5.0", "walkdir", "winapi", "winres", @@ -1144,7 +1142,7 @@ dependencies = [ "async-trait", "deno_core", "tokio", - "uuid 1.4.1", + "uuid 1.5.0", ] [[package]] @@ -1167,7 +1165,7 @@ checksum = "2bbb245d9a3719b5eb2b5195aaaa25108c3c93d1762b181a20fb1af1c7703eaf" dependencies = [ "anyhow", "deno_media_type", - "indexmap 2.0.0", + "indexmap 2.0.2", "log", "once_cell", "parking_lot 0.12.1", @@ -1185,7 +1183,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fed704bc09eb4f88b26b16c75f87795d1ea1e658e26867fe684cef91c55543f1" dependencies = [ "anyhow", - "indexmap 2.0.0", + "indexmap 2.0.2", "jsonc-parser", "log", "percent-encoding", @@ -1213,7 +1211,7 @@ dependencies = [ "deno_ops", "deno_unsync 0.3.0", "futures", - "indexmap 2.0.0", + "indexmap 2.0.2", "libc", "log", "once_cell", @@ -1259,7 +1257,7 @@ dependencies = [ "signature 1.6.4", "spki 0.6.0", "tokio", - "uuid 1.4.1", + "uuid 1.5.0", "x25519-dalek", ] @@ -1362,7 +1360,7 @@ dependencies = [ "deno_semver", "futures", "import_map", - "indexmap 2.0.0", + "indexmap 2.0.2", "monch", "once_cell", "parking_lot 0.12.1", @@ -1447,7 +1445,7 @@ dependencies = [ "termcolor", "tokio", "url", - "uuid 1.4.1", + "uuid 1.5.0", ] [[package]] @@ -1539,7 +1537,7 @@ dependencies = [ "hkdf", "http", "idna 0.3.0", - "indexmap 2.0.0", + "indexmap 2.0.2", "lazy-regex", "libc", "libz-sys", @@ -1662,7 +1660,7 @@ dependencies = [ "test_util", "tokio", "tokio-metrics", - "uuid 1.4.1", + "uuid 1.5.0", "which", "winapi", "winres", @@ -1757,7 +1755,7 @@ dependencies = [ "futures", "serde", "tokio", - "uuid 1.4.1", + "uuid 1.5.0", "windows-sys", ] @@ -2660,9 +2658,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" dependencies = [ "ahash 0.8.3", "allocator-api2", @@ -2674,7 +2672,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.2", ] [[package]] @@ -2929,12 +2927,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.2", "serde", ] @@ -3802,7 +3800,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap 2.0.2", ] [[package]] @@ -4129,23 +4127,24 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quick-junit" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf780b59d590c25f8c59b44c124166a2a93587868b619fb8f5b47fb15e9ed6d" +checksum = "1b9599bffc2cd7511355996e0cfd979266b2cfa3f3ff5247d07a3a6e1ded6158" dependencies = [ "chrono", - "indexmap 2.0.0", + "indexmap 2.0.2", "nextest-workspace-hack", "quick-xml", + "strip-ansi-escapes", "thiserror", - "uuid 1.4.1", + "uuid 1.5.0", ] [[package]] name = "quick-xml" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b9228215d82c7b61490fec1de287136b5de6f5700f6e58ea9ad61a7964ca51" +checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33" dependencies = [ "memchr", ] @@ -4783,7 +4782,7 @@ version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "itoa", "ryu", "serde", @@ -5088,6 +5087,15 @@ dependencies = [ "syn 2.0.37", ] +[[package]] +name = "strip-ansi-escapes" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ff8ef943b384c414f54aefa961dd2bd853add74ec75e7ac74cf91dba62bcfa" +dependencies = [ + "vte", +] + [[package]] name = "strsim" version = "0.10.0" @@ -5706,18 +5714,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2 1.0.67", "quote 1.0.33", @@ -5901,7 +5909,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.2", "toml_datetime", "winnow", ] @@ -6291,9 +6299,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" dependencies = [ "getrandom 0.2.10", "serde", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index bae8c4ab0f7b4c..de51163507c5bb 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -103,7 +103,7 @@ once_cell.workspace = true os_pipe.workspace = true percent-encoding.workspace = true pin-project.workspace = true -quick-junit = "^0.3.3" +quick-junit = "^0.3.5" rand = { workspace = true, features = ["small_rng"] } regex.workspace = true ring.workspace = true From f3b580d001cfed0c6df55c5be3f89b4e58719421 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Sat, 28 Oct 2023 19:49:21 -0700 Subject: [PATCH 10/10] chore: use is_terminal in atty (#21010) --- runtime/ops/tty.rs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/runtime/ops/tty.rs b/runtime/ops/tty.rs index 8157a4517ca59e..bf85c757e95a56 100644 --- a/runtime/ops/tty.rs +++ b/runtime/ops/tty.rs @@ -1,12 +1,10 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. use std::io::Error; -use std::io::IsTerminal; use deno_core::error::AnyError; use deno_core::op2; use deno_core::OpState; -use deno_core::ResourceHandle; #[cfg(unix)] use deno_core::ResourceId; @@ -167,24 +165,7 @@ fn op_stdin_set_raw( #[op2(fast)] fn op_isatty(state: &mut OpState, rid: u32) -> Result { let handle = state.resource_table.get_handle(rid)?; - // TODO(mmastrac): this can migrate to the deno_core implementation when it lands - Ok(match handle { - ResourceHandle::Fd(fd) if handle.is_valid() => { - #[cfg(windows)] - { - // SAFETY: The resource remains open for the for the duration of borrow_raw - unsafe { - std::os::windows::io::BorrowedHandle::borrow_raw(fd).is_terminal() - } - } - #[cfg(unix)] - { - // SAFETY: The resource remains open for the for the duration of borrow_raw - unsafe { std::os::fd::BorrowedFd::borrow_raw(fd).is_terminal() } - } - } - _ => false, - }) + Ok(handle.is_terminal()) } #[op2(fast)]