diff options
115 files changed, 189 insertions, 243 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs index e027a72b9..4801737a8 100644 --- a/cli/args/flags.rs +++ b/cli/args/flags.rs @@ -1109,11 +1109,11 @@ fn bundle_subcommand() -> Command { .long_about( "Output a single JavaScript file with all dependencies. - deno bundle https://deno.land/std/examples/colors.ts colors.bundle.js + deno bundle https://deno.land/std/http/file_server.ts file_server.bundle.js If no output file is given, the output is written to standard output: - deno bundle https://deno.land/std/examples/colors.ts", + deno bundle https://deno.land/std/http/file_server.ts", ) .defer(|cmd| { compile_args(cmd) @@ -1201,7 +1201,7 @@ fn compile_subcommand() -> Command { "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 + deno compile --output file_server https://deno.land/std/http/file_server.ts Any flags passed which affect runtime behavior, such as '--unstable', '--allow-*', '--v8-flags', etc. are encoded into the output executable and @@ -1730,7 +1730,7 @@ fn install_subcommand() -> Command { "Installs a script as an executable in the installation root's bin directory. deno install --allow-net --allow-read https://deno.land/std/http/file_server.ts - deno install https://deno.land/std/examples/colors.ts + deno install https://examples.deno.land/color-logging.ts To change the executable name, use -n/--name: @@ -6365,14 +6365,14 @@ mod tests { let r = flags_from_vec(svec![ "deno", "install", - "https://deno.land/std/examples/colors.ts" + "https://deno.land/std/http/file_server.ts" ]); assert_eq!( r.unwrap(), Flags { subcommand: DenoSubcommand::Install(InstallFlags { name: None, - module_url: "https://deno.land/std/examples/colors.ts".to_string(), + module_url: "https://deno.land/std/http/file_server.ts".to_string(), args: vec![], root: None, force: false, @@ -7839,13 +7839,14 @@ mod tests { let r = flags_from_vec(svec![ "deno", "compile", - "https://deno.land/std/examples/colors.ts" + "https://examples.deno.land/color-logging.ts" ]); assert_eq!( r.unwrap(), Flags { subcommand: DenoSubcommand::Compile(CompileFlags { - source_file: "https://deno.land/std/examples/colors.ts".to_string(), + source_file: "https://examples.deno.land/color-logging.ts" + .to_string(), output: None, args: vec![], target: None, @@ -7861,12 +7862,13 @@ mod tests { #[test] fn compile_with_flags() { #[rustfmt::skip] - let r = flags_from_vec(svec!["deno", "compile", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--no-terminal", "--output", "colors", "--env=.example.env", "https://deno.land/std/examples/colors.ts", "foo", "bar", "-p", "8080"]); + let r = flags_from_vec(svec!["deno", "compile", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--location", "https:foo", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--no-terminal", "--output", "colors", "--env=.example.env", "https://examples.deno.land/color-logging.ts", "foo", "bar", "-p", "8080"]); assert_eq!( r.unwrap(), Flags { subcommand: DenoSubcommand::Compile(CompileFlags { - source_file: "https://deno.land/std/examples/colors.ts".to_string(), + source_file: "https://examples.deno.land/color-logging.ts" + .to_string(), output: Some(PathBuf::from("colors")), args: svec!["foo", "bar", "-p", "8080"], target: None, diff --git a/cli/bench/main.rs b/cli/bench/main.rs index 7ecef2b6f..f8e3aa03f 100644 --- a/cli/bench/main.rs +++ b/cli/bench/main.rs @@ -130,7 +130,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[ "check", "--reload", "--unstable", - "test_util/std/examples/chat/server_test.ts", + "test_util/std/http/file_server_test.ts", ], None, ), @@ -141,7 +141,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[ "--reload", "--no-check", "--unstable", - "test_util/std/examples/chat/server_test.ts", + "test_util/std/http/file_server_test.ts", ], None, ), @@ -150,7 +150,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[ &[ "bundle", "--unstable", - "test_util/std/examples/chat/server_test.ts", + "test_util/std/http/file_server_test.ts", ], None, ), @@ -160,7 +160,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[ "bundle", "--no-check", "--unstable", - "test_util/std/examples/chat/server_test.ts", + "test_util/std/http/file_server_test.ts", ], None, ), @@ -314,7 +314,7 @@ fn get_binary_sizes(target_dir: &Path) -> Result<HashMap<String, i64>> { const BUNDLES: &[(&str, &str)] = &[ ("file_server", "./test_util/std/http/file_server.ts"), - ("gist", "./test_util/std/examples/gist.ts"), + ("welcome", "./cli/tests/testdata/welcome.ts"), ]; fn bundle_benchmark(deno_exe: &Path) -> Result<HashMap<String, i64>> { let mut sizes = HashMap::<String, i64>::new(); diff --git a/cli/lsp/diagnostics.rs b/cli/lsp/diagnostics.rs index 4b43a478c..00f535391 100644 --- a/cli/lsp/diagnostics.rs +++ b/cli/lsp/diagnostics.rs @@ -1650,14 +1650,27 @@ let c: number = "a"; let (snapshot, _) = setup( &temp_dir, &[ - ("file:///std/testing/asserts.ts", "export function assert() {}", 1, LanguageId::TypeScript), - ("file:///a/file.ts", "import { assert } from \"../std/testing/asserts.ts\";\n\nassert();\n", 1, LanguageId::TypeScript), + ( + "file:///std/assert/mod.ts", + "export function assert() {}", + 1, + LanguageId::TypeScript, + ), + ( + "file:///a/file.ts", + "import { assert } from \"../std/assert/mod.ts\";\n\nassert();\n", + 1, + LanguageId::TypeScript, + ), ], - Some(("file:///a/import-map.json", r#"{ + Some(( + "file:///a/import-map.json", + r#"{ "imports": { "/~/std/": "../std/" } - }"#)), + }"#, + )), ); let config = mock_config(); let token = CancellationToken::new(); @@ -1665,7 +1678,7 @@ let c: number = "a"; assert_eq!(actual.len(), 2); for record in actual { match record.specifier.as_str() { - "file:///std/testing/asserts.ts" => { + "file:///std/assert/mod.ts" => { assert_eq!(json!(record.versioned.diagnostics), json!([])) } "file:///a/file.ts" => assert_eq!( @@ -1679,16 +1692,16 @@ let c: number = "a"; }, "end": { "line": 0, - "character": 50 + "character": 45 } }, "severity": 4, "code": "import-map-remap", "source": "deno", - "message": "The import specifier can be remapped to \"/~/std/testing/asserts.ts\" which will resolve it via the active import map.", + "message": "The import specifier can be remapped to \"/~/std/assert/mod.ts\" which will resolve it via the active import map.", "data": { - "from": "../std/testing/asserts.ts", - "to": "/~/std/testing/asserts.ts" + "from": "../std/assert/mod.ts", + "to": "/~/std/assert/mod.ts" } } ]) @@ -1709,10 +1722,10 @@ let c: number = "a"; severity: Some(lsp::DiagnosticSeverity::HINT), code: Some(lsp::NumberOrString::String("import-map-remap".to_string())), source: Some("deno".to_string()), - message: "The import specifier can be remapped to \"/~/std/testing/asserts.ts\" which will resolve it via the active import map.".to_string(), + message: "The import specifier can be remapped to \"/~/std/assert/mod.ts\" which will resolve it via the active import map.".to_string(), data: Some(json!({ - "from": "../std/testing/asserts.ts", - "to": "/~/std/testing/asserts.ts" + "from": "../std/assert/mod.ts", + "to": "/~/std/assert/mod.ts" })), ..Default::default() }); @@ -1721,7 +1734,7 @@ let c: number = "a"; assert_eq!( json!(actual), json!({ - "title": "Update \"../std/testing/asserts.ts\" to \"/~/std/testing/asserts.ts\" to use import map.", + "title": "Update \"../std/assert/mod.ts\" to \"/~/std/assert/mod.ts\" to use import map.", "kind": "quickfix", "diagnostics": [ { @@ -1738,10 +1751,10 @@ let c: number = "a"; "severity": 4, "code": "import-map-remap", "source": "deno", - "message": "The import specifier can be remapped to \"/~/std/testing/asserts.ts\" which will resolve it via the active import map.", + "message": "The import specifier can be remapped to \"/~/std/assert/mod.ts\" which will resolve it via the active import map.", "data": { - "from": "../std/testing/asserts.ts", - "to": "/~/std/testing/asserts.ts" + "from": "../std/assert/mod.ts", + "to": "/~/std/assert/mod.ts" } } ], @@ -1759,7 +1772,7 @@ let c: number = "a"; "character": 50 } }, - "newText": "\"/~/std/testing/asserts.ts\"" + "newText": "\"/~/std/assert/mod.ts\"" } ] } diff --git a/cli/tests/integration/compile_tests.rs b/cli/tests/integration/compile_tests.rs index 653b2bc8d..9963a044b 100644 --- a/cli/tests/integration/compile_tests.rs +++ b/cli/tests/integration/compile_tests.rs @@ -24,7 +24,7 @@ fn compile_basic() { "compile", "--output", &exe.to_string_lossy(), - "../../../test_util/std/examples/welcome.ts", + "../../../cli/tests/testdata/welcome.ts", ]) .run(); output.assert_exit_code(0); diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index 26268f0a4..da3d6d6e5 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -1302,7 +1302,7 @@ fn lsp_hover() { "language": "typescript", "value": "const Deno.args: string[]" }, - "Returns the script arguments to the program.\n\nGive the following command line invocation of Deno:\n\n```sh\ndeno run --allow-read https://deno.land/std/examples/cat.ts /etc/passwd\n```\n\nThen `Deno.args` will contain:\n\n```ts\n[ \"/etc/passwd\" ]\n```\n\nIf you are looking for a structured way to parse arguments, there is the\n[`std/flags`](https://deno.land/std/flags) module as part of the Deno\nstandard library.", + "Returns the script arguments to the program.\n\nGive the following command line invocation of Deno:\n\n```sh\ndeno run --allow-read https://examples.deno.land/command-line-arguments.ts Sushi\n```\n\nThen `Deno.args` will contain:\n\n```ts\n[ \"Sushi\" ]\n```\n\nIf you are looking for a structured way to parse arguments, there is the\n[`std/flags`](https://deno.land/std/flags) module as part of the Deno\nstandard library.", "\n\n*@category* - Runtime Environment", ], "range": { diff --git a/cli/tests/node_compat/common.ts b/cli/tests/node_compat/common.ts index 1b9748f26..7de7026cd 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 3f3d7bd21..e716bfd8b 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 d7dde3a85..beb4a450e 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 778e98420..e723ed868 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 da60383f0..c1aa4b31d 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 a1bf83875..00ebc0f5c 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/coverage/no_tests_included/foo.test.js b/cli/tests/testdata/coverage/no_tests_included/foo.test.js index 12da76d02..f555c2d0a 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 12da76d02..f555c2d0a 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 12da76d02..f555c2d0a 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 fae96ed35..480945d14 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 792bd654f..3438a045c 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 df25283cd..7e4f22163 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 8ca733a94..eacce1130 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 0d7cb96da..b6d9c506e 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 f4157b86f..971ddaea3 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 126627e34..191c4d872 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 a942d2729..e89699854 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 bd1d41096..18a0783fc 100644 --- a/cli/tests/testdata/run/tls_connecttls.js +++ b/cli/tests/testdata/run/tls_connecttls.js @@ -1,7 +1,4 @@ -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 4acc21461..3d84ac74a 100644 --- a/cli/tests/testdata/run/tls_starttls.js +++ b/cli/tests/testdata/run/tls_starttls.js @@ -1,7 +1,4 @@ -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 b99c1a61f..fa267c41b 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"; const errorDeferred = Promise.withResolvers<void>(); const closeDeferred = Promise.withResolvers<void>(); diff --git a/cli/tests/testdata/run/websocket_test.ts b/cli/tests/testdata/run/websocket_test.ts index c534db99f..566e44206 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"; Deno.test("invalid scheme", () => { assertThrows(() => new WebSocket("foo://localhost:4242")); diff --git a/cli/tests/testdata/run/websocketstream_test.ts b/cli/tests/testdata/run/websocketstream_test.ts index 82dd59a20..f34eaf0ab 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 c7a238130..50cd407e4 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 3153b9755..eb760242a 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/welcome.ts b/cli/tests/testdata/welcome.ts new file mode 100644 index 000000000..f983ca89b --- /dev/null +++ b/cli/tests/testdata/welcome.ts @@ -0,0 +1 @@ +console.log("Welcome to Deno!"); diff --git a/cli/tests/testdata/workers/deno_worker.ts b/cli/tests/testdata/workers/deno_worker.ts index a4dca1506..eccdab5b0 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 71f56a8c2..0f0a2e1c6 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"; Deno.test({ name: "worker terminate", diff --git a/cli/tests/unit/broadcast_channel_test.ts b/cli/tests/unit/broadcast_channel_test.ts index fecb26b16..f8b0ef933 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"; Deno.test("BroadcastChannel worker", async () => { const intercom = new BroadcastChannel("intercom"); diff --git a/cli/tests/unit/message_channel_test.ts b/cli/tests/unit/message_channel_test.ts index 8872fc68b..306d89730 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"; Deno.test("messagechannel", async () => { const mc = new MessageChannel(); diff --git a/cli/tests/unit/opcall_test.ts b/cli/tests/unit/opcall_test.ts index fb269fc32..d2c65440c 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 f99b09377..7e94ceb96 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 c7dc9e80b..3cd1dde38 100644 --- a/cli/tests/unit/test_util.ts +++ b/cli/tests/unit/test_util.ts @@ -19,7 +19,7 @@ export { fail, unimplemented, unreachable, -} from "../../../test_util/std/testing/asserts.ts"; +} from "../../../test_util/std/assert/mod.ts"; export { delay } from "../../../test_util/std/async/delay.ts"; export { readLines } from "../../../test_util/std/io/read_lines.ts"; export { parse as parseArgs } from "../../../test_util/std/flags/mod.ts"; diff --git a/cli/tests/unit_node/_fs/_fs_access_test.ts b/cli/tests/unit_node/_fs/_fs_access_test.ts index 5fd2a5b31..15fa2410f 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 5741938f0..377015934 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 11f01d1ad..4704f612f 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 2174d49d7..4fd2d6c8c 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 4d0743dbd..d14ad1b73 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 b08e8d7f3..cea6e65ab 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 7f53ee1d3..eb8a0073b 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 eca693f6f..8a3f066ea 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 9af5b3208..49dad173d 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 d7ccae927..6253dffff 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 70c3db254..fe578aa51 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 586c7d7e6..0d055fdce 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 46787bec1..67bc8262e 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 c5b9012a5..3b76807ff 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 8cfbf6490..232206860 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 a96457eb0..3594b56fe 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 cd1127989..c09f840eb 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 0deae9276..b55ffd4a4 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 998128596..e1e2c148e 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 d9f5e5796..f7a7192b8 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 196bea777..5219643f2 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 8fa9e7b01..335a7cfc7 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 3ca303037..d61217304 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 bb1df079f..b2ec353c5 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 7f0d3cef8..0d134023b 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 871ebe983..df7fb8da3 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 cefd7f61a..8310cdb58 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 e196ee08a..cb4ae1aa1 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 85aaa2ec3..7bbae6270 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 b9e33c507..776d89ecc 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 72747ebfa..f16188fee 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 3aff3fac2..98fb6c5f0 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 a33534fbb..b92224844 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 170c0d73d..a2d3e605c 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 26b0da8b9..916343599 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 9f123e005..b96f4d29b 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 7baa81b7d..afc15f29f 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 322067719..514818bce 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 ab6ed5bc3..ac0636942 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 035e970d4..861da8a2d 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"; Deno.test(async function foo() { const asyncLocalStorage = new AsyncLocalStorage(); diff --git a/cli/tests/unit_node/buffer_test.ts b/cli/tests/unit_node/buffer_test.ts index 5244764c6..cfd1bf748 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 d5d41125d..79617cf3d 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 * as path from "../../../test_util/std/path/mod.ts"; const { spawn, spawnSync, execFile, execFileSync, ChildProcess } = CP; 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 e1ef44058..2ed9c1d87 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 0eecaacf0..52a9b06ec 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 4b0aedf03..3167628ce 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 e59874d7a..b4cc6e69e 100644 --- a/cli/tests/unit_node/crypto/crypto_key_test.ts +++ b/cli/tests/unit_node/crypto/crypto_key_test.ts @@ -14,7 +14,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 RUN_SLOW_TESTS = Deno.env.get("SLOW_TESTS") === "1"; diff --git a/cli/tests/unit_node/crypto/crypto_sign_test.ts b/cli/tests/unit_node/crypto/crypto_sign_test.ts index 9988ed71c..58107b563 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 3e9ad4480..310113233 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 87ad6c748..461986c81 100644 --- a/cli/tests/unit_node/http2_test.ts +++ b/cli/tests/unit_node/http2_test.ts @@ -2,7 +2,7 @@ import * as http2 from "node:http2"; import * as net from "node:net"; -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 ef78432cb..b2b8eda0f 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 { gzip } from "node:zlib"; diff --git a/cli/tests/unit_node/internal/_randomBytes_test.ts b/cli/tests/unit_node/internal/_randomBytes_test.ts index 1072ce164..69845705e 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 5d56ca65a..5afcf23d5 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"; const validateNonZero = (buf: Buffer) => { if (!buf.some((ch) => ch > 0)) throw new Error("Error"); diff --git a/cli/tests/unit_node/internal/_randomInt_test.ts b/cli/tests/unit_node/internal/_randomInt_test.ts index 4bed13498..36d8a2146 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 3d3378769..79c379d9a 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 83830f8e4..4e75d9ac7 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"; Deno.test("scrypt works correctly", async () => { const { promise, resolve } = Promise.withResolvers<boolean>(); diff --git a/cli/tests/unit_node/module_test.ts b/cli/tests/unit_node/module_test.ts index 9818f4766..8ecef7fa4 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 e55adafcb..037176303 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 * 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 54dc375bb..7ce29bea3 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 48298afec..8b1af9ee1 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 d1ab8c12c..e7cda40ab 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 e79ff3468..69af8a3ad 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 * as path from "../../../test_util/std/path/mod.ts"; import { delay } from "../../../test_util/std/async/delay.ts"; diff --git a/cli/tests/unit_node/querystring_test.ts b/cli/tests/unit_node/querystring_test.ts index 0b3b22d62..bd5548223 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 914d23e4a..8978b53ff 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 e703d69f8..9df8d0375 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 058d3ca7c..9d3d3df08 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 93ff69dc3..facd4cc4e 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 d110b44e4..f6c8f7773 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 0a3a91144..a4d157d93 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 { fromFileUrl, join } from "../../../test_util/std/path/mod.ts"; import { serveTls } from "../../../test_util/std/http/server.ts"; diff --git a/cli/tests/unit_node/tty_test.ts b/cli/tests/unit_node/tty_test.ts index d2bf32efc..930f1aaff 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 e90eed831..0c95d9f5a 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 724ac3504..8eb67701e 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 a43a1b506..0271995e6 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 c025849da..5f82b1202 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 { fromFileUrl, relative } from "../../../test_util/std/path/mod.ts"; import { brotliCompressSync, diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index ed24736fc..401f9fa97 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", @@ -818,7 +818,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", @@ -859,7 +859,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", @@ -896,7 +896,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"); @@ -922,7 +922,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"); @@ -945,7 +945,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"); @@ -972,7 +972,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( * { @@ -1010,7 +1010,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 } }, @@ -1234,7 +1234,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", @@ -1273,7 +1273,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"); @@ -1301,7 +1301,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"); @@ -1326,7 +1326,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", @@ -1363,7 +1363,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 } }, @@ -1397,7 +1397,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 } }, @@ -2451,7 +2451,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(); @@ -2463,7 +2463,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(); @@ -3513,7 +3513,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); * ``` @@ -3530,7 +3530,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); * ``` @@ -3546,7 +3546,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); * ``` @@ -3562,7 +3562,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); * ``` @@ -4794,7 +4794,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") @@ -4805,7 +4805,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") @@ -4883,14 +4883,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") @@ -4986,13 +4986,13 @@ declare namespace Deno { * Give the following command line invocation of Deno: * * ```sh - * deno run --allow-read https://deno.land/std/examples/cat.ts /etc/passwd + * deno run --allow-read https://examples.deno.land/command-line-arguments.ts Sushi * ``` * * Then `Deno.args` will contain: * * ```ts - * [ "/etc/passwd" ] + * [ "Sushi" ] * ``` * * If you are looking for a structured way to parse arguments, there is the @@ -5200,7 +5200,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); @@ -5216,7 +5216,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/ext/node/polyfills/_util/std_asserts.ts b/ext/node/polyfills/_util/std_asserts.ts index ac5715cae..4258a7495 100644 --- a/ext/node/polyfills/_util/std_asserts.ts +++ b/ext/node/polyfills/_util/std_asserts.ts @@ -1,5 +1,5 @@ // Copyright 2018-2023 the Deno authors. All rights reserved. MIT license. -// vendored from std/testing/asserts.ts +// vendored from std/assert/mod.ts // TODO(petamoriken): enable prefer-primordials for node polyfills // deno-lint-ignore-file prefer-primordials diff --git a/test_ffi/tests/test.js b/test_ffi/tests/test.js index b91dc43de..c8a92e397 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 ede045666..6ed9c63a0 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 -Subproject b23a76a47adaf63b5493761a87e6dd0dc0de0bb +Subproject e0ef24091e87f84d44d495d432d611625b28124 |