Skip to content

Commit

Permalink
chore: update std to 0.208.0 (denoland#21318)
Browse files Browse the repository at this point in the history
Re-attempt at denoland#21284. I was more thorough this time.

---------

Signed-off-by: Asher Gomez <[email protected]>
  • Loading branch information
iuioiua authored Dec 2, 2023
1 parent ec0207e commit d2b5254
Show file tree
Hide file tree
Showing 115 changed files with 190 additions and 244 deletions.
22 changes: 12 additions & 10 deletions cli/args/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
10 changes: 5 additions & 5 deletions cli/bench/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand All @@ -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,
),
Expand Down Expand Up @@ -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();
Expand Down
47 changes: 30 additions & 17 deletions cli/lsp/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1650,22 +1650,35 @@ let c: number = "a";
let (snapshot, _) = setup(
&temp_dir,
&[
("file:https:///std/testing/asserts.ts", "export function assert() {}", 1, LanguageId::TypeScript),
("file:https:///a/file.ts", "import { assert } from \"../std/testing/asserts.ts\";\n\nassert();\n", 1, LanguageId::TypeScript),
(
"file:https:///std/assert/mod.ts",
"export function assert() {}",
1,
LanguageId::TypeScript,
),
(
"file:https:///a/file.ts",
"import { assert } from \"../std/assert/mod.ts\";\n\nassert();\n",
1,
LanguageId::TypeScript,
),
],
Some(("file:https:///a/import-map.json", r#"{
Some((
"file:https:///a/import-map.json",
r#"{
"imports": {
"/~/std/": "../std/"
}
}"#)),
}"#,
)),
);
let config = mock_config();
let token = CancellationToken::new();
let actual = generate_deno_diagnostics(&snapshot, &config, token);
assert_eq!(actual.len(), 2);
for record in actual {
match record.specifier.as_str() {
"file:https:///std/testing/asserts.ts" => {
"file:https:///std/assert/mod.ts" => {
assert_eq!(json!(record.versioned.diagnostics), json!([]))
}
"file:https:///a/file.ts" => assert_eq!(
Expand All @@ -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"
}
}
])
Expand All @@ -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()
});
Expand All @@ -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": [
{
Expand All @@ -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"
}
}
],
Expand All @@ -1759,7 +1772,7 @@ let c: number = "a";
"character": 50
}
},
"newText": "\"/~/std/testing/asserts.ts\""
"newText": "\"/~/std/assert/mod.ts\""
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/integration/compile_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/integration/lsp_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/node_compat/common.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { partition } from "../../../test_util/std/collections/partition.ts";
import { join } from "../../../test_util/std/path/mod.ts";
import * as JSONC from "../../../test_util/std/encoding/jsonc.ts";
import * as JSONC from "../../../test_util/std/jsonc/mod.ts";
/**
* The test suite matches the folders inside the `test` folder inside the
* node repo
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/node_compat/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { magenta } from "../../../test_util/std/fmt/colors.ts";
import { pooledMap } from "../../../test_util/std/async/pool.ts";
import { dirname, fromFileUrl, join } from "../../../test_util/std/path/mod.ts";
import { fail } from "../../../test_util/std/testing/asserts.ts";
import { fail } from "../../../test_util/std/assert/mod.ts";
import {
config,
getPathsFromTestSuites,
Expand Down
2 changes: 1 addition & 1 deletion cli/tests/testdata/bench/allow_all.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";

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

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

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

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

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

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

export * from "./interface.ts";
2 changes: 1 addition & 1 deletion cli/tests/testdata/run/045_proxy_test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
import { Server } from "../../../../test_util/std/http/server.ts";
import { assertEquals } from "../../../../test_util/std/testing/asserts.ts";
import { assertEquals } from "../../../../test_util/std/assert/mod.ts";

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

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

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

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

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

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

const handler = (e: Event) => {
assert(e.type === "beforeunload" ? e.cancelable : !e.cancelable);
Expand Down
5 changes: 1 addition & 4 deletions cli/tests/testdata/run/tls_connecttls.js
Original file line number Diff line number Diff line change
@@ -1,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";

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

const errorDeferred = Promise.withResolvers<void>();
const closeDeferred = Promise.withResolvers<void>();
Expand Down
Loading

0 comments on commit d2b5254

Please sign in to comment.