mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore: update std to 0.208.0 (#21318)
Re-attempt at #21284. I was more thorough this time. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
parent
ec0207e9b1
commit
d2b5254c33
115 changed files with 190 additions and 244 deletions
|
@ -1109,11 +1109,11 @@ fn bundle_subcommand() -> Command {
|
||||||
.long_about(
|
.long_about(
|
||||||
"Output a single JavaScript file with all dependencies.
|
"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:
|
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| {
|
.defer(|cmd| {
|
||||||
compile_args(cmd)
|
compile_args(cmd)
|
||||||
|
@ -1201,7 +1201,7 @@ fn compile_subcommand() -> Command {
|
||||||
"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 -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',
|
Any flags passed which affect runtime behavior, such as '--unstable',
|
||||||
'--allow-*', '--v8-flags', etc. are encoded into the output executable and
|
'--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.
|
"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 --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:
|
To change the executable name, use -n/--name:
|
||||||
|
|
||||||
|
@ -6365,14 +6365,14 @@ mod tests {
|
||||||
let r = flags_from_vec(svec![
|
let r = flags_from_vec(svec![
|
||||||
"deno",
|
"deno",
|
||||||
"install",
|
"install",
|
||||||
"https://deno.land/std/examples/colors.ts"
|
"https://deno.land/std/http/file_server.ts"
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r.unwrap(),
|
r.unwrap(),
|
||||||
Flags {
|
Flags {
|
||||||
subcommand: DenoSubcommand::Install(InstallFlags {
|
subcommand: DenoSubcommand::Install(InstallFlags {
|
||||||
name: None,
|
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![],
|
args: vec![],
|
||||||
root: None,
|
root: None,
|
||||||
force: false,
|
force: false,
|
||||||
|
@ -7839,13 +7839,14 @@ mod tests {
|
||||||
let r = flags_from_vec(svec![
|
let r = flags_from_vec(svec![
|
||||||
"deno",
|
"deno",
|
||||||
"compile",
|
"compile",
|
||||||
"https://deno.land/std/examples/colors.ts"
|
"https://examples.deno.land/color-logging.ts"
|
||||||
]);
|
]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
r.unwrap(),
|
r.unwrap(),
|
||||||
Flags {
|
Flags {
|
||||||
subcommand: DenoSubcommand::Compile(CompileFlags {
|
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,
|
output: None,
|
||||||
args: vec![],
|
args: vec![],
|
||||||
target: None,
|
target: None,
|
||||||
|
@ -7861,12 +7862,13 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn compile_with_flags() {
|
fn compile_with_flags() {
|
||||||
#[rustfmt::skip]
|
#[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!(
|
assert_eq!(
|
||||||
r.unwrap(),
|
r.unwrap(),
|
||||||
Flags {
|
Flags {
|
||||||
subcommand: DenoSubcommand::Compile(CompileFlags {
|
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")),
|
output: Some(PathBuf::from("colors")),
|
||||||
args: svec!["foo", "bar", "-p", "8080"],
|
args: svec!["foo", "bar", "-p", "8080"],
|
||||||
target: None,
|
target: None,
|
||||||
|
|
|
@ -130,7 +130,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
|
||||||
"check",
|
"check",
|
||||||
"--reload",
|
"--reload",
|
||||||
"--unstable",
|
"--unstable",
|
||||||
"test_util/std/examples/chat/server_test.ts",
|
"test_util/std/http/file_server_test.ts",
|
||||||
],
|
],
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
|
@ -141,7 +141,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
|
||||||
"--reload",
|
"--reload",
|
||||||
"--no-check",
|
"--no-check",
|
||||||
"--unstable",
|
"--unstable",
|
||||||
"test_util/std/examples/chat/server_test.ts",
|
"test_util/std/http/file_server_test.ts",
|
||||||
],
|
],
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
|
@ -150,7 +150,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
|
||||||
&[
|
&[
|
||||||
"bundle",
|
"bundle",
|
||||||
"--unstable",
|
"--unstable",
|
||||||
"test_util/std/examples/chat/server_test.ts",
|
"test_util/std/http/file_server_test.ts",
|
||||||
],
|
],
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
|
@ -160,7 +160,7 @@ const EXEC_TIME_BENCHMARKS: &[(&str, &[&str], Option<i32>)] = &[
|
||||||
"bundle",
|
"bundle",
|
||||||
"--no-check",
|
"--no-check",
|
||||||
"--unstable",
|
"--unstable",
|
||||||
"test_util/std/examples/chat/server_test.ts",
|
"test_util/std/http/file_server_test.ts",
|
||||||
],
|
],
|
||||||
None,
|
None,
|
||||||
),
|
),
|
||||||
|
@ -314,7 +314,7 @@ fn get_binary_sizes(target_dir: &Path) -> Result<HashMap<String, i64>> {
|
||||||
|
|
||||||
const BUNDLES: &[(&str, &str)] = &[
|
const BUNDLES: &[(&str, &str)] = &[
|
||||||
("file_server", "./test_util/std/http/file_server.ts"),
|
("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>> {
|
fn bundle_benchmark(deno_exe: &Path) -> Result<HashMap<String, i64>> {
|
||||||
let mut sizes = HashMap::<String, i64>::new();
|
let mut sizes = HashMap::<String, i64>::new();
|
||||||
|
|
|
@ -1650,14 +1650,27 @@ let c: number = "a";
|
||||||
let (snapshot, _) = setup(
|
let (snapshot, _) = setup(
|
||||||
&temp_dir,
|
&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": {
|
"imports": {
|
||||||
"/~/std/": "../std/"
|
"/~/std/": "../std/"
|
||||||
}
|
}
|
||||||
}"#)),
|
}"#,
|
||||||
|
)),
|
||||||
);
|
);
|
||||||
let config = mock_config();
|
let config = mock_config();
|
||||||
let token = CancellationToken::new();
|
let token = CancellationToken::new();
|
||||||
|
@ -1665,7 +1678,7 @@ let c: number = "a";
|
||||||
assert_eq!(actual.len(), 2);
|
assert_eq!(actual.len(), 2);
|
||||||
for record in actual {
|
for record in actual {
|
||||||
match record.specifier.as_str() {
|
match record.specifier.as_str() {
|
||||||
"file:///std/testing/asserts.ts" => {
|
"file:///std/assert/mod.ts" => {
|
||||||
assert_eq!(json!(record.versioned.diagnostics), json!([]))
|
assert_eq!(json!(record.versioned.diagnostics), json!([]))
|
||||||
}
|
}
|
||||||
"file:///a/file.ts" => assert_eq!(
|
"file:///a/file.ts" => assert_eq!(
|
||||||
|
@ -1679,16 +1692,16 @@ let c: number = "a";
|
||||||
},
|
},
|
||||||
"end": {
|
"end": {
|
||||||
"line": 0,
|
"line": 0,
|
||||||
"character": 50
|
"character": 45
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"severity": 4,
|
"severity": 4,
|
||||||
"code": "import-map-remap",
|
"code": "import-map-remap",
|
||||||
"source": "deno",
|
"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": {
|
"data": {
|
||||||
"from": "../std/testing/asserts.ts",
|
"from": "../std/assert/mod.ts",
|
||||||
"to": "/~/std/testing/asserts.ts"
|
"to": "/~/std/assert/mod.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
@ -1709,10 +1722,10 @@ let c: number = "a";
|
||||||
severity: Some(lsp::DiagnosticSeverity::HINT),
|
severity: Some(lsp::DiagnosticSeverity::HINT),
|
||||||
code: Some(lsp::NumberOrString::String("import-map-remap".to_string())),
|
code: Some(lsp::NumberOrString::String("import-map-remap".to_string())),
|
||||||
source: Some("deno".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!({
|
data: Some(json!({
|
||||||
"from": "../std/testing/asserts.ts",
|
"from": "../std/assert/mod.ts",
|
||||||
"to": "/~/std/testing/asserts.ts"
|
"to": "/~/std/assert/mod.ts"
|
||||||
})),
|
})),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
|
@ -1721,7 +1734,7 @@ let c: number = "a";
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
json!(actual),
|
json!(actual),
|
||||||
json!({
|
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",
|
"kind": "quickfix",
|
||||||
"diagnostics": [
|
"diagnostics": [
|
||||||
{
|
{
|
||||||
|
@ -1738,10 +1751,10 @@ let c: number = "a";
|
||||||
"severity": 4,
|
"severity": 4,
|
||||||
"code": "import-map-remap",
|
"code": "import-map-remap",
|
||||||
"source": "deno",
|
"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": {
|
"data": {
|
||||||
"from": "../std/testing/asserts.ts",
|
"from": "../std/assert/mod.ts",
|
||||||
"to": "/~/std/testing/asserts.ts"
|
"to": "/~/std/assert/mod.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
@ -1759,7 +1772,7 @@ let c: number = "a";
|
||||||
"character": 50
|
"character": 50
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"newText": "\"/~/std/testing/asserts.ts\""
|
"newText": "\"/~/std/assert/mod.ts\""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ fn compile_basic() {
|
||||||
"compile",
|
"compile",
|
||||||
"--output",
|
"--output",
|
||||||
&exe.to_string_lossy(),
|
&exe.to_string_lossy(),
|
||||||
"../../../test_util/std/examples/welcome.ts",
|
"../../../cli/tests/testdata/welcome.ts",
|
||||||
])
|
])
|
||||||
.run();
|
.run();
|
||||||
output.assert_exit_code(0);
|
output.assert_exit_code(0);
|
||||||
|
|
|
@ -1302,7 +1302,7 @@ fn lsp_hover() {
|
||||||
"language": "typescript",
|
"language": "typescript",
|
||||||
"value": "const Deno.args: string[]"
|
"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",
|
"\n\n*@category* - Runtime Environment",
|
||||||
],
|
],
|
||||||
"range": {
|
"range": {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { partition } from "../../../test_util/std/collections/partition.ts";
|
import { partition } from "../../../test_util/std/collections/partition.ts";
|
||||||
import { join } from "../../../test_util/std/path/mod.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
|
* The test suite matches the folders inside the `test` folder inside the
|
||||||
* node repo
|
* node repo
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
import { magenta } from "../../../test_util/std/fmt/colors.ts";
|
import { magenta } from "../../../test_util/std/fmt/colors.ts";
|
||||||
import { pooledMap } from "../../../test_util/std/async/pool.ts";
|
import { pooledMap } from "../../../test_util/std/async/pool.ts";
|
||||||
import { dirname, fromFileUrl, join } from "../../../test_util/std/path/mod.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 {
|
import {
|
||||||
config,
|
config,
|
||||||
getPathsFromTestSuites,
|
getPathsFromTestSuites,
|
||||||
|
|
2
cli/tests/testdata/bench/allow_all.ts
vendored
2
cli/tests/testdata/bench/allow_all.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
const permissions: Deno.PermissionName[] = [
|
const permissions: Deno.PermissionName[] = [
|
||||||
"read",
|
"read",
|
||||||
|
|
2
cli/tests/testdata/bench/allow_none.ts
vendored
2
cli/tests/testdata/bench/allow_none.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { unreachable } from "../../../../test_util/std/testing/asserts.ts";
|
import { unreachable } from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
const permissions: Deno.PermissionName[] = [
|
const permissions: Deno.PermissionName[] = [
|
||||||
"read",
|
"read",
|
||||||
|
|
|
@ -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({
|
const listener = Deno.listenTls({
|
||||||
port: Number(Deno.args[0]),
|
port: Number(Deno.args[0]),
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
import {
|
import {
|
||||||
assertNotEquals as _a,
|
assertNotEquals as _a,
|
||||||
assertStrictEquals as _b,
|
assertStrictEquals as _b,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { addNumbers } from "./foo.ts";
|
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", () => {
|
Deno.test("addNumbers works", () => {
|
||||||
assertEquals(addNumbers(1, 2), 3);
|
assertEquals(addNumbers(1, 2), 3);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { addNumbers } from "./foo.ts";
|
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", () => {
|
Deno.test("addNumbers works", () => {
|
||||||
assertEquals(addNumbers(1, 2), 3);
|
assertEquals(addNumbers(1, 2), 3);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { addNumbers } from "./foo.ts";
|
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", () => {
|
Deno.test("addNumbers works", () => {
|
||||||
assertEquals(addNumbers(1, 2), 3);
|
assertEquals(addNumbers(1, 2), 3);
|
||||||
|
|
|
@ -4,9 +4,7 @@ FNH:0
|
||||||
BRF:0
|
BRF:0
|
||||||
BRH:0
|
BRH:0
|
||||||
DA:1,1
|
DA:1,1
|
||||||
DA:2,1
|
|
||||||
DA:3,1
|
DA:3,1
|
||||||
DA:5,1
|
LH:2
|
||||||
LH:4
|
LF:2
|
||||||
LF:4
|
|
||||||
end_of_record
|
end_of_record
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
cover [WILDCARD]index.ts ... 100.000% (4/4)
|
cover [WILDCARD]index.ts ... 100.000% (2/2)
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
export {
|
export { assertStrictEquals } from "../../../../../test_util/std/assert/mod.ts";
|
||||||
assertStrictEquals,
|
|
||||||
} from "../../../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
export * from "./interface.ts";
|
export * from "./interface.ts";
|
||||||
|
|
2
cli/tests/testdata/run/045_proxy_test.ts
vendored
2
cli/tests/testdata/run/045_proxy_test.ts
vendored
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { Server } from "../../../../test_util/std/http/server.ts";
|
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";
|
const addr = Deno.args[1] || "localhost:4555";
|
||||||
|
|
||||||
|
|
2
cli/tests/testdata/run/import_meta/main.ts
vendored
2
cli/tests/testdata/run/import_meta/main.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { assertThrows } from "../../../../../test_util/std/testing/asserts.ts";
|
import { assertThrows } from "../../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
console.log("main", import.meta.url, import.meta.main);
|
console.log("main", import.meta.url, import.meta.main);
|
||||||
|
|
||||||
|
|
2
cli/tests/testdata/run/onload/imported.ts
vendored
2
cli/tests/testdata/run/onload/imported.ts
vendored
|
@ -1,5 +1,5 @@
|
||||||
// deno-lint-ignore-file no-window-prefix
|
// 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";
|
import "./nest_imported.ts";
|
||||||
|
|
||||||
const handler = (e: Event) => {
|
const handler = (e: Event) => {
|
||||||
|
|
2
cli/tests/testdata/run/onload/main.ts
vendored
2
cli/tests/testdata/run/onload/main.ts
vendored
|
@ -1,5 +1,5 @@
|
||||||
// deno-lint-ignore-file no-window-prefix no-prototype-builtins
|
// 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";
|
import "./imported.ts";
|
||||||
|
|
||||||
assert(window.hasOwnProperty("onload"));
|
assert(window.hasOwnProperty("onload"));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// deno-lint-ignore-file no-window-prefix
|
// 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) => {
|
const handler = (e: Event) => {
|
||||||
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
|
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
|
||||||
|
|
5
cli/tests/testdata/run/tls_connecttls.js
vendored
5
cli/tests/testdata/run/tls_connecttls.js
vendored
|
@ -1,7 +1,4 @@
|
||||||
import {
|
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { BufReader, BufWriter } from "../../../../test_util/std/io/mod.ts";
|
import { BufReader, BufWriter } from "../../../../test_util/std/io/mod.ts";
|
||||||
import { TextProtoReader } from "./textproto.ts";
|
import { TextProtoReader } from "./textproto.ts";
|
||||||
|
|
||||||
|
|
5
cli/tests/testdata/run/tls_starttls.js
vendored
5
cli/tests/testdata/run/tls_starttls.js
vendored
|
@ -1,7 +1,4 @@
|
||||||
import {
|
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { BufReader } from "../../../../test_util/std/io/buf_reader.ts";
|
import { BufReader } from "../../../../test_util/std/io/buf_reader.ts";
|
||||||
import { BufWriter } from "../../../../test_util/std/io/buf_writer.ts";
|
import { BufWriter } from "../../../../test_util/std/io/buf_writer.ts";
|
||||||
import { TextProtoReader } from "./textproto.ts";
|
import { TextProtoReader } from "./textproto.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 errorDeferred = Promise.withResolvers<void>();
|
||||||
const closeDeferred = Promise.withResolvers<void>();
|
const closeDeferred = Promise.withResolvers<void>();
|
||||||
|
|
2
cli/tests/testdata/run/websocket_test.ts
vendored
2
cli/tests/testdata/run/websocket_test.ts
vendored
|
@ -4,7 +4,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
Deno.test("invalid scheme", () => {
|
Deno.test("invalid scheme", () => {
|
||||||
assertThrows(() => new WebSocket("foo://localhost:4242"));
|
assertThrows(() => new WebSocket("foo://localhost:4242"));
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
assertRejects,
|
assertRejects,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
unreachable,
|
unreachable,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
Deno.test("fragment", () => {
|
Deno.test("fragment", () => {
|
||||||
assertThrows(() => new WebSocketStream("ws://localhost:4242/#"));
|
assertThrows(() => new WebSocketStream("ws://localhost:4242/#"));
|
||||||
|
|
2
cli/tests/testdata/test/allow_all.ts
vendored
2
cli/tests/testdata/test/allow_all.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
|
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
const permissions: Deno.PermissionName[] = [
|
const permissions: Deno.PermissionName[] = [
|
||||||
"read",
|
"read",
|
||||||
|
|
2
cli/tests/testdata/test/allow_none.ts
vendored
2
cli/tests/testdata/test/allow_none.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { unreachable } from "../../../../test_util/std/testing/asserts.ts";
|
import { unreachable } from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
const permissions: Deno.PermissionName[] = [
|
const permissions: Deno.PermissionName[] = [
|
||||||
"read",
|
"read",
|
||||||
|
|
1
cli/tests/testdata/welcome.ts
vendored
Normal file
1
cli/tests/testdata/welcome.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
console.log("Welcome to Deno!");
|
2
cli/tests/testdata/workers/deno_worker.ts
vendored
2
cli/tests/testdata/workers/deno_worker.ts
vendored
|
@ -1,4 +1,4 @@
|
||||||
import { assert } from "../../../../test_util/std/testing/asserts.ts";
|
import { assert } from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
onmessage = function (e) {
|
onmessage = function (e) {
|
||||||
if (typeof self.Deno === "undefined") {
|
if (typeof self.Deno === "undefined") {
|
||||||
|
|
2
cli/tests/testdata/workers/test.ts
vendored
2
cli/tests/testdata/workers/test.ts
vendored
|
@ -7,7 +7,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertMatch,
|
assertMatch,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
name: "worker terminate",
|
name: "worker terminate",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// 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 () => {
|
Deno.test("BroadcastChannel worker", async () => {
|
||||||
const intercom = new BroadcastChannel("intercom");
|
const intercom = new BroadcastChannel("intercom");
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
// NOTE: these are just sometests to test the TypeScript types. Real coverage is
|
// NOTE: these are just sometests to test the TypeScript types. Real coverage is
|
||||||
// provided by WPT.
|
// provided by WPT.
|
||||||
import {
|
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
Deno.test("messagechannel", async () => {
|
Deno.test("messagechannel", async () => {
|
||||||
const mc = new MessageChannel();
|
const mc = new MessageChannel();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// 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";
|
import { assert, assertStringIncludes, unreachable } from "./test_util.ts";
|
||||||
|
|
||||||
Deno.test(async function sendAsyncStackTrace() {
|
Deno.test(async function sendAsyncStackTrace() {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import {
|
import {
|
||||||
assertMatch,
|
assertMatch,
|
||||||
assertRejects,
|
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 { Buffer, BufReader, BufWriter } from "../../../test_util/std/io/mod.ts";
|
||||||
import { TextProtoReader } from "../testdata/run/textproto.ts";
|
import { TextProtoReader } from "../testdata/run/textproto.ts";
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -19,7 +19,7 @@ export {
|
||||||
fail,
|
fail,
|
||||||
unimplemented,
|
unimplemented,
|
||||||
unreachable,
|
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 { delay } from "../../../test_util/std/async/delay.ts";
|
||||||
export { readLines } from "../../../test_util/std/io/read_lines.ts";
|
export { readLines } from "../../../test_util/std/io/read_lines.ts";
|
||||||
export { parse as parseArgs } from "../../../test_util/std/flags/mod.ts";
|
export { parse as parseArgs } from "../../../test_util/std/flags/mod.ts";
|
||||||
|
|
|
@ -3,7 +3,7 @@ import * as fs from "node:fs";
|
||||||
import {
|
import {
|
||||||
assertRejects,
|
assertRejects,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
Deno.test(
|
Deno.test(
|
||||||
"[node/fs.access] Uses the owner permission when the user is the owner",
|
"[node/fs.access] Uses the owner permission when the user is the owner",
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { appendFile, appendFileSync } from "node:fs";
|
import { appendFile, appendFileSync } from "node:fs";
|
||||||
import { fromFileUrl } from "../../../../test_util/std/path/mod.ts";
|
import { fromFileUrl } from "../../../../test_util/std/path/mod.ts";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
assertRejects,
|
assertRejects,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { chmod, chmodSync } from "node:fs";
|
import { chmod, chmodSync } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import {
|
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assertEquals,
|
|
||||||
fail,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { chown, chownSync } from "node:fs";
|
import { chown, chownSync } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { close, closeSync } from "node:fs";
|
import { close, closeSync } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
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 { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { copyFile, copyFileSync, existsSync } from "node:fs";
|
import { copyFile, copyFileSync, existsSync } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { Dir as DirOrig, type Dirent } from "node:fs";
|
import { Dir as DirOrig, type Dirent } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { Dirent as Dirent_ } from "node:fs";
|
import { Dirent as Dirent_ } from "node:fs";
|
||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertStringIncludes,
|
assertStringIncludes,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { exists, existsSync } from "node:fs";
|
import { exists, existsSync } from "node:fs";
|
||||||
import { promisify } from "node:util";
|
import { promisify } from "node:util";
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import {
|
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assertEquals,
|
|
||||||
fail,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { fdatasync, fdatasyncSync } from "node:fs";
|
import { fdatasync, fdatasyncSync } from "node:fs";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { fstat, fstatSync } from "node:fs";
|
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 { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts";
|
||||||
import type { BigIntStats, Stats } from "node:fs";
|
import type { BigIntStats, Stats } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import {
|
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assertEquals,
|
|
||||||
fail,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { fsync, fsyncSync } from "node:fs";
|
import { fsync, fsyncSync } from "node:fs";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { ftruncate, ftruncateSync } from "node:fs";
|
import { ftruncate, ftruncateSync } from "node:fs";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { futimes, futimesSync } from "node:fs";
|
import { futimes, futimesSync } from "node:fs";
|
||||||
|
|
||||||
const randomDate = new Date(Date.now() + 1000);
|
const randomDate = new Date(Date.now() + 1000);
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
import * as fs from "node:fs/promises";
|
import * as fs from "node:fs/promises";
|
||||||
import {
|
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
|
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
|
||||||
const testData = path.resolve(moduleDir, "testdata", "hello.txt");
|
const testData = path.resolve(moduleDir, "testdata", "hello.txt");
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { link, linkSync } from "node:fs";
|
import { link, linkSync } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { lstat, lstatSync } from "node:fs";
|
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 { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts";
|
import { assertStats, assertStatsBigInt } from "./_fs_stat_test.ts";
|
||||||
import type { BigIntStats, Stats } from "node:fs";
|
import type { BigIntStats, Stats } from "node:fs";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
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 { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { existsSync, mkdir, mkdirSync } from "node:fs";
|
import { existsSync, mkdir, mkdirSync } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertRejects,
|
assertRejects,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { EncodingOption, existsSync, mkdtemp, mkdtempSync } from "node:fs";
|
import { EncodingOption, existsSync, mkdtemp, mkdtempSync } from "node:fs";
|
||||||
import { env } from "node:process";
|
import { env } from "node:process";
|
||||||
import { promisify } from "node:util";
|
import { promisify } from "node:util";
|
||||||
|
|
|
@ -14,7 +14,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { open, openSync } from "node:fs";
|
import { open, openSync } from "node:fs";
|
||||||
import { join, parse } from "node:path";
|
import { join, parse } from "node:path";
|
||||||
|
|
|
@ -6,7 +6,7 @@ import {
|
||||||
assertFalse,
|
assertFalse,
|
||||||
assertInstanceOf,
|
assertInstanceOf,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { opendir, opendirSync } from "node:fs";
|
import { opendir, opendirSync } from "node:fs";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
|
|
|
@ -2,10 +2,7 @@
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { readFile, readFileSync } from "node:fs";
|
import { readFile, readFileSync } from "node:fs";
|
||||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||||
import {
|
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
|
const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
|
||||||
const testData = path.resolve(moduleDir, "testdata", "hello.txt");
|
const testData = path.resolve(moduleDir, "testdata", "hello.txt");
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
assertFalse,
|
assertFalse,
|
||||||
assertMatch,
|
assertMatch,
|
||||||
assertStrictEquals,
|
assertStrictEquals,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { read, readSync } from "node:fs";
|
import { read, readSync } from "node:fs";
|
||||||
import { open, openSync } from "node:fs";
|
import { open, openSync } from "node:fs";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertNotEquals,
|
assertNotEquals,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { readdir, readdirSync } from "node:fs";
|
import { readdir, readdirSync } from "node:fs";
|
||||||
import { join } from "../../../../test_util/std/path/mod.ts";
|
import { join } from "../../../../test_util/std/path/mod.ts";
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { readlink, readlinkSync } from "node:fs";
|
import { readlink, readlinkSync } from "node:fs";
|
||||||
import {
|
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||||
|
|
||||||
const testDir = Deno.makeTempDirSync();
|
const testDir = Deno.makeTempDirSync();
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
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 { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { realpath, realpathSync } from "node:fs";
|
import { realpath, realpathSync } from "node:fs";
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import {
|
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assertEquals,
|
|
||||||
fail,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { rename, renameSync } from "node:fs";
|
import { rename, renameSync } from "node:fs";
|
||||||
import { existsSync } from "node:fs";
|
import { existsSync } from "node:fs";
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
assertRejects,
|
assertRejects,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { rm, rmSync } from "node:fs";
|
import { rm, rmSync } from "node:fs";
|
||||||
import { closeSync, existsSync } from "node:fs";
|
import { closeSync, existsSync } from "node:fs";
|
||||||
import { join } from "../../../../test_util/std/path/mod.ts";
|
import { join } from "../../../../test_util/std/path/mod.ts";
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import {
|
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assertEquals,
|
|
||||||
fail,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { rmdir, rmdirSync } from "node:fs";
|
import { rmdir, rmdirSync } from "node:fs";
|
||||||
import { closeSync } from "node:fs";
|
import { closeSync } from "node:fs";
|
||||||
import { existsSync } from "node:fs";
|
import { existsSync } from "node:fs";
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { BigIntStats, stat, Stats, statSync } from "node:fs";
|
import { BigIntStats, stat, Stats, statSync } from "node:fs";
|
||||||
import {
|
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assertEquals,
|
|
||||||
fail,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
export function assertStats(actual: Stats, expected: Deno.FileInfo) {
|
export function assertStats(actual: Stats, expected: Deno.FileInfo) {
|
||||||
assertEquals(actual.dev, expected.dev);
|
assertEquals(actual.dev, expected.dev);
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { symlink, symlinkSync } from "node:fs";
|
import { symlink, symlinkSync } from "node:fs";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { truncate, truncateSync } from "node:fs";
|
import { truncate, truncateSync } from "node:fs";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import {
|
import { assertEquals, fail } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assertEquals,
|
|
||||||
fail,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { existsSync } from "node:fs";
|
import { existsSync } from "node:fs";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { unlink, unlinkSync } from "node:fs";
|
import { unlink, unlinkSync } from "node:fs";
|
||||||
|
|
|
@ -3,7 +3,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
fail,
|
fail,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { utimes, utimesSync } from "node:fs";
|
import { utimes, utimesSync } from "node:fs";
|
||||||
|
|
||||||
const randomDate = new Date(Date.now() + 1000);
|
const randomDate = new Date(Date.now() + 1000);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { watch } from "node:fs";
|
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) {
|
function wait(time: number) {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
assertNotEquals,
|
assertNotEquals,
|
||||||
assertRejects,
|
assertRejects,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { writeFile, writeFileSync } from "node:fs";
|
import { writeFile, writeFileSync } from "node:fs";
|
||||||
import * as path from "../../../../test_util/std/path/mod.ts";
|
import * as path from "../../../../test_util/std/path/mod.ts";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { write, writeSync } from "node:fs";
|
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";
|
import { Buffer } from "node:buffer";
|
||||||
|
|
||||||
const decoder = new TextDecoder("utf-8");
|
const decoder = new TextDecoder("utf-8");
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
assertStringIncludes,
|
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. */
|
/** Asserts that an error thrown in a callback will not be wrongly caught. */
|
||||||
export async function assertCallbackErrorUncaught(
|
export async function assertCallbackErrorUncaught(
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { stripColor } from "../../../test_util/std/fmt/colors.ts";
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
assertStrictEquals,
|
assertStrictEquals,
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
} from "../../../test_util/std/assert/mod.ts";
|
||||||
import { AssertionError } from "node:assert";
|
import { AssertionError } from "node:assert";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
import { AsyncLocalStorage, AsyncResource } from "node:async_hooks";
|
||||||
import {
|
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
Deno.test(async function foo() {
|
Deno.test(async function foo() {
|
||||||
const asyncLocalStorage = new AsyncLocalStorage();
|
const asyncLocalStorage = new AsyncLocalStorage();
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Buffer } from "node:buffer";
|
||||||
import {
|
import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
} from "../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
name: "[node/buffer] alloc fails if size is not a number",
|
name: "[node/buffer] alloc fails if size is not a number",
|
||||||
|
|
|
@ -9,7 +9,7 @@ import {
|
||||||
assertNotStrictEquals,
|
assertNotStrictEquals,
|
||||||
assertStrictEquals,
|
assertStrictEquals,
|
||||||
assertStringIncludes,
|
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";
|
import * as path from "../../../test_util/std/path/mod.ts";
|
||||||
|
|
||||||
const { spawn, spawnSync, execFile, execFileSync, ChildProcess } = CP;
|
const { spawn, spawnSync, execFile, execFileSync, ChildProcess } = CP;
|
||||||
|
|
|
@ -4,7 +4,7 @@ import crypto from "node:crypto";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
import testVectors128 from "./gcmEncryptExtIV128.json" assert { type: "json" };
|
import testVectors128 from "./gcmEncryptExtIV128.json" assert { type: "json" };
|
||||||
import testVectors256 from "./gcmEncryptExtIV256.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 aesGcm = (bits: string, key: Uint8Array) => {
|
||||||
const ALGO = bits == "128" ? `aes-128-gcm` : `aes-256-gcm`;
|
const ALGO = bits == "128" ? `aes-128-gcm` : `aes-256-gcm`;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { buffer, text } from "node:stream/consumers";
|
||||||
import {
|
import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
const rsaPrivateKey = Deno.readTextFileSync(
|
const rsaPrivateKey = Deno.readTextFileSync(
|
||||||
new URL("../testdata/rsa_private.pem", import.meta.url),
|
new URL("../testdata/rsa_private.pem", import.meta.url),
|
||||||
|
|
|
@ -8,10 +8,7 @@ import {
|
||||||
} from "node:crypto";
|
} from "node:crypto";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
import { Readable } from "node:stream";
|
import { Readable } from "node:stream";
|
||||||
import {
|
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
// https://github.com/denoland/deno/issues/18140
|
// https://github.com/denoland/deno/issues/18140
|
||||||
Deno.test({
|
Deno.test({
|
||||||
|
|
|
@ -14,7 +14,7 @@ import { Buffer } from "node:buffer";
|
||||||
import {
|
import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { createHmac } from "node:crypto";
|
import { createHmac } from "node:crypto";
|
||||||
|
|
||||||
const RUN_SLOW_TESTS = Deno.env.get("SLOW_TESTS") === "1";
|
const RUN_SLOW_TESTS = Deno.env.get("SLOW_TESTS") === "1";
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import {
|
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { createSign, createVerify, sign, verify } from "node:crypto";
|
import { createSign, createVerify, sign, verify } from "node:crypto";
|
||||||
import { Buffer } from "node:buffer";
|
import { Buffer } from "node:buffer";
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import {
|
import { assert, assertThrows } from "../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertThrows,
|
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
|
||||||
import { join } from "node:path";
|
import { join } from "node:path";
|
||||||
import { tmpdir } from "node:os";
|
import { tmpdir } from "node:os";
|
||||||
import { mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
import { mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import * as http2 from "node:http2";
|
import * as http2 from "node:http2";
|
||||||
import * as net from "node:net";
|
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"]) {
|
for (const url of ["http://127.0.0.1:4246", "https://127.0.0.1:4247"]) {
|
||||||
Deno.test(`[node/http2 client] ${url}`, {
|
Deno.test(`[node/http2 client] ${url}`, {
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
assert,
|
assert,
|
||||||
assertEquals,
|
assertEquals,
|
||||||
fail,
|
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 { assertSpyCalls, spy } from "../../../test_util/std/testing/mock.ts";
|
||||||
|
|
||||||
import { gzip } from "node:zlib";
|
import { gzip } from "node:zlib";
|
||||||
|
|
|
@ -4,7 +4,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertRejects,
|
assertRejects,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
import { assertCallbackErrorUncaught } from "../_test_utils.ts";
|
||||||
import { randomBytes } from "node:crypto";
|
import { randomBytes } from "node:crypto";
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertNotEquals,
|
assertNotEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
} from "../../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
const validateNonZero = (buf: Buffer) => {
|
const validateNonZero = (buf: Buffer) => {
|
||||||
if (!buf.some((ch) => ch > 0)) throw new Error("Error");
|
if (!buf.some((ch) => ch > 0)) throw new Error("Error");
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { randomInt } from "node:crypto";
|
import { randomInt } from "node:crypto";
|
||||||
import {
|
import { assert, assertThrows } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertThrows,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
const between = (x: number, min: number, max: number) => x >= min && x < max;
|
const between = (x: number, min: number, max: number) => x >= min && x < max;
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { pbkdf2, pbkdf2Sync } from "node:crypto";
|
import { pbkdf2, pbkdf2Sync } from "node:crypto";
|
||||||
import {
|
import { assert, assertEquals } from "../../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../../test_util/std/testing/asserts.ts";
|
|
||||||
|
|
||||||
type Algorithms =
|
type Algorithms =
|
||||||
| "md5"
|
| "md5"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { scrypt, scryptSync } from "node:crypto";
|
import { scrypt, scryptSync } from "node:crypto";
|
||||||
import { Buffer } from "node:buffer";
|
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 () => {
|
Deno.test("scrypt works correctly", async () => {
|
||||||
const { promise, resolve } = Promise.withResolvers<boolean>();
|
const { promise, resolve } = Promise.withResolvers<boolean>();
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import { createRequire, Module } from "node:module";
|
import { createRequire, Module } from "node:module";
|
||||||
import {
|
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
|
||||||
import process from "node:process";
|
import process from "node:process";
|
||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
|
|
||||||
import * as net from "node:net";
|
import * as net from "node:net";
|
||||||
import {
|
import { assert, assertEquals } from "../../../test_util/std/assert/mod.ts";
|
||||||
assert,
|
|
||||||
assertEquals,
|
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
|
||||||
import * as path from "../../../test_util/std/path/mod.ts";
|
import * as path from "../../../test_util/std/path/mod.ts";
|
||||||
import * as http from "node:http";
|
import * as http from "node:http";
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertNotEquals,
|
assertNotEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
} from "../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
name: "build architecture is a string",
|
name: "build architecture is a string",
|
||||||
|
|
|
@ -4,7 +4,7 @@ import path from "node:path";
|
||||||
import posix from "node:path/posix";
|
import posix from "node:path/posix";
|
||||||
import win32 from "node:path/win32";
|
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", () => {
|
Deno.test("[node/path] posix and win32 objects", () => {
|
||||||
assertStrictEquals(path.posix, posix);
|
assertStrictEquals(path.posix, posix);
|
||||||
|
|
|
@ -4,7 +4,7 @@ import { performance } from "node:perf_hooks";
|
||||||
import {
|
import {
|
||||||
assertEquals,
|
assertEquals,
|
||||||
assertThrows,
|
assertThrows,
|
||||||
} from "../../../test_util/std/testing/asserts.ts";
|
} from "../../../test_util/std/assert/mod.ts";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
name: "[perf_hooks] performance",
|
name: "[perf_hooks] performance",
|
||||||
|
|
|
@ -11,7 +11,7 @@ import {
|
||||||
assertObjectMatch,
|
assertObjectMatch,
|
||||||
assertStrictEquals,
|
assertStrictEquals,
|
||||||
assertThrows,
|
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 { stripColor } from "../../../test_util/std/fmt/colors.ts";
|
||||||
import * as path from "../../../test_util/std/path/mod.ts";
|
import * as path from "../../../test_util/std/path/mod.ts";
|
||||||
import { delay } from "../../../test_util/std/async/delay.ts";
|
import { delay } from "../../../test_util/std/async/delay.ts";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// 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";
|
import { parse, stringify } from "node:querystring";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
|
||||||
import { createInterface, Interface } from "node:readline";
|
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";
|
import { Readable, Writable } from "node:stream";
|
||||||
|
|
||||||
Deno.test("[node/readline] createInstance", () => {
|
Deno.test("[node/readline] createInstance", () => {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue