diff options
Diffstat (limited to 'cli/tests/integration')
-rw-r--r-- | cli/tests/integration/coverage_tests.rs | 37 | ||||
-rw-r--r-- | cli/tests/integration/fmt_tests.rs | 3 | ||||
-rw-r--r-- | cli/tests/integration/inspector_tests.rs | 7 | ||||
-rw-r--r-- | cli/tests/integration/lsp_tests.rs | 2 | ||||
-rw-r--r-- | cli/tests/integration/repl_tests.rs | 2 | ||||
-rw-r--r-- | cli/tests/integration/run_tests.rs | 21 | ||||
-rw-r--r-- | cli/tests/integration/vendor_tests.rs | 4 | ||||
-rw-r--r-- | cli/tests/integration/watcher_tests.rs | 4 |
8 files changed, 37 insertions, 43 deletions
diff --git a/cli/tests/integration/coverage_tests.rs b/cli/tests/integration/coverage_tests.rs index 5f82971c6..87ed655b8 100644 --- a/cli/tests/integration/coverage_tests.rs +++ b/cli/tests/integration/coverage_tests.rs @@ -97,7 +97,7 @@ fn run_coverage_text(test_name: &str, extension: &str) { .arg("--quiet") .arg("--unstable") .arg(format!("--coverage={}", tempdir.to_str().unwrap())) - .arg(format!("coverage/{}_test.{}", test_name, extension)) + .arg(format!("coverage/{test_name}_test.{extension}")) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::inherit()) .status() @@ -123,13 +123,13 @@ fn run_coverage_text(test_name: &str, extension: &str) { .to_string(); let expected = fs::read_to_string( - util::testdata_path().join(format!("coverage/{}_expected.out", test_name)), + util::testdata_path().join(format!("coverage/{test_name}_expected.out")), ) .unwrap(); if !util::wildcard_match(&expected, &actual) { - println!("OUTPUT\n{}\nOUTPUT", actual); - println!("EXPECTED\n{}\nEXPECTED", expected); + println!("OUTPUT\n{actual}\nOUTPUT"); + println!("EXPECTED\n{expected}\nEXPECTED"); panic!("pattern match failed"); } @@ -152,13 +152,13 @@ fn run_coverage_text(test_name: &str, extension: &str) { .to_string(); let expected = fs::read_to_string( - util::testdata_path().join(format!("coverage/{}_expected.lcov", test_name)), + util::testdata_path().join(format!("coverage/{test_name}_expected.lcov")), ) .unwrap(); if !util::wildcard_match(&expected, &actual) { - println!("OUTPUT\n{}\nOUTPUT", actual); - println!("EXPECTED\n{}\nEXPECTED", expected); + println!("OUTPUT\n{actual}\nOUTPUT"); + println!("EXPECTED\n{expected}\nEXPECTED"); panic!("pattern match failed"); } @@ -208,8 +208,8 @@ fn multifile_coverage() { .unwrap(); if !util::wildcard_match(&expected, &actual) { - println!("OUTPUT\n{}\nOUTPUT", actual); - println!("EXPECTED\n{}\nEXPECTED", expected); + println!("OUTPUT\n{actual}\nOUTPUT"); + println!("EXPECTED\n{expected}\nEXPECTED"); panic!("pattern match failed"); } @@ -237,8 +237,8 @@ fn multifile_coverage() { .unwrap(); if !util::wildcard_match(&expected, &actual) { - println!("OUTPUT\n{}\nOUTPUT", actual); - println!("EXPECTED\n{}\nEXPECTED", expected); + println!("OUTPUT\n{actual}\nOUTPUT"); + println!("EXPECTED\n{expected}\nEXPECTED"); panic!("pattern match failed"); } @@ -258,8 +258,7 @@ fn no_snaps_included(test_name: &str, extension: &str) { .arg("--allow-read") .arg(format!("--coverage={}", tempdir.to_str().unwrap())) .arg(format!( - "coverage/no_snaps_included/{}_test.{}", - test_name, extension + "coverage/no_snaps_included/{test_name}_test.{extension}" )) .stdout(std::process::Stdio::piped()) .stderr(std::process::Stdio::piped()) @@ -292,8 +291,8 @@ fn no_snaps_included(test_name: &str, extension: &str) { .unwrap(); if !util::wildcard_match(&expected, &actual) { - println!("OUTPUT\n{}\nOUTPUT", actual); - println!("EXPECTED\n{}\nEXPECTED", expected); + println!("OUTPUT\n{actual}\nOUTPUT"); + println!("EXPECTED\n{expected}\nEXPECTED"); panic!("pattern match failed"); } @@ -339,8 +338,8 @@ fn no_transpiled_lines() { .unwrap(); if !util::wildcard_match(&expected, &actual) { - println!("OUTPUT\n{}\nOUTPUT", actual); - println!("EXPECTED\n{}\nEXPECTED", expected); + println!("OUTPUT\n{actual}\nOUTPUT"); + println!("EXPECTED\n{expected}\nEXPECTED"); panic!("pattern match failed"); } @@ -367,8 +366,8 @@ fn no_transpiled_lines() { .unwrap(); if !util::wildcard_match(&expected, &actual) { - println!("OUTPUT\n{}\nOUTPUT", actual); - println!("EXPECTED\n{}\nEXPECTED", expected); + println!("OUTPUT\n{actual}\nOUTPUT"); + println!("EXPECTED\n{expected}\nEXPECTED"); panic!("pattern match failed"); } diff --git a/cli/tests/integration/fmt_tests.rs b/cli/tests/integration/fmt_tests.rs index d230f96c0..52aae2bd3 100644 --- a/cli/tests/integration/fmt_tests.rs +++ b/cli/tests/integration/fmt_tests.rs @@ -31,8 +31,7 @@ fn fmt_test() { .current_dir(&testdata_fmt_dir) .arg("fmt") .arg(format!( - "--ignore={},{},{}", - badly_formatted_js_str, badly_formatted_md_str, badly_formatted_json_str + "--ignore={badly_formatted_js_str},{badly_formatted_md_str},{badly_formatted_json_str}" )) .arg("--check") .arg(badly_formatted_js_str) diff --git a/cli/tests/integration/inspector_tests.rs b/cli/tests/integration/inspector_tests.rs index 5b01522d5..bfc3a63e0 100644 --- a/cli/tests/integration/inspector_tests.rs +++ b/cli/tests/integration/inspector_tests.rs @@ -103,8 +103,7 @@ impl InspectorTester { self.child.kill().unwrap(); panic!( - "Inspector test failed with error: {:?}.\nstdout:\n{}\nstderr:\n{}", - err, stdout, stderr + "Inspector test failed with error: {err:?}.\nstdout:\n{stdout}\nstderr:\n{stderr}" ); } } @@ -215,7 +214,7 @@ fn inspect_flag_with_unique_port(flag_prefix: &str) -> String { use std::sync::atomic::Ordering; static PORT: AtomicU16 = AtomicU16::new(9229); let port = PORT.fetch_add(1, Ordering::Relaxed); - format!("{}=127.0.0.1:{}", flag_prefix, port) + format!("{flag_prefix}=127.0.0.1:{port}") } fn extract_ws_url_from_stderr( @@ -508,7 +507,7 @@ async fn inspector_does_not_hang() { .await; tester .assert_received_messages( - &[&format!(r#"{{"id":{},"result":{{}}}}"#, request_id)], + &[&format!(r#"{{"id":{request_id},"result":{{}}}}"#)], &[r#"{"method":"Debugger.resumed","params":{}}"#], ) .await; diff --git a/cli/tests/integration/lsp_tests.rs b/cli/tests/integration/lsp_tests.rs index be280bfa7..1fd619a40 100644 --- a/cli/tests/integration/lsp_tests.rs +++ b/cli/tests/integration/lsp_tests.rs @@ -103,7 +103,7 @@ pub fn ensure_directory_specifier( ) -> ModuleSpecifier { let path = specifier.path(); if !path.ends_with('/') { - let new_path = format!("{}/", path); + let new_path = format!("{path}/"); specifier.set_path(&new_path); } specifier diff --git a/cli/tests/integration/repl_tests.rs b/cli/tests/integration/repl_tests.rs index af9fce187..30d91bc1c 100644 --- a/cli/tests/integration/repl_tests.rs +++ b/cli/tests/integration/repl_tests.rs @@ -673,7 +673,7 @@ fn assign_underscore_error() { Some(vec![("NO_COLOR".to_owned(), "1".to_owned())]), false, ); - println!("{}", out); + println!("{out}"); assert_ends_with!( out, "Last thrown error is no longer saved to _error.\n1\nUncaught 2\n1\n" diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index fd6644326..923232f9d 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -1942,9 +1942,9 @@ mod permissions { .current_dir(&util::testdata_path()) .arg("run") .arg("--unstable") - .arg(format!("--allow-{0}", permission)) + .arg(format!("--allow-{permission}")) .arg("run/permission_test.ts") - .arg(format!("{0}Required", permission)) + .arg(format!("{permission}Required")) .spawn() .unwrap() .wait() @@ -1959,10 +1959,7 @@ mod permissions { for permission in &util::PERMISSION_VARIANTS { let (_, err) = util::run_and_collect_output( false, - &format!( - "run --unstable run/permission_test.ts {0}Required", - permission - ), + &format!("run --unstable run/permission_test.ts {permission}Required"), None, None, false, @@ -2100,7 +2097,7 @@ mod permissions { let status = util::deno_cmd() .current_dir(&util::testdata_path()) .arg("run") - .arg(format!("--allow-{0}={1},{2}", permission, test_dir, js_dir)) + .arg(format!("--allow-{permission}={test_dir},{js_dir}")) .arg("run/complex_permissions_test.ts") .arg(permission) .arg("run/complex_permissions_test.ts") @@ -2119,7 +2116,7 @@ mod permissions { let status = util::deno_cmd() .current_dir(&util::testdata_path()) .arg("run") - .arg(format!("--allow-{0}=.", permission)) + .arg(format!("--allow-{permission}=.")) .arg("run/complex_permissions_test.ts") .arg(permission) .arg("run/complex_permissions_test.ts") @@ -2138,7 +2135,7 @@ mod permissions { let status = util::deno_cmd() .current_dir(&util::testdata_path()) .arg("run") - .arg(format!("--allow-{0}=tls/../", permission)) + .arg(format!("--allow-{permission}=tls/../")) .arg("run/complex_permissions_test.ts") .arg(permission) .arg("run/complex_permissions_test.ts") @@ -3251,7 +3248,7 @@ fn basic_auth_tokens() { assert!(stdout_str.is_empty()); let stderr_str = std::str::from_utf8(&output.stderr).unwrap().trim(); - eprintln!("{}", stderr_str); + eprintln!("{stderr_str}"); assert!(stderr_str .contains("Module not found \"http://127.0.0.1:4554/run/001_hello.js\".")); @@ -3269,7 +3266,7 @@ fn basic_auth_tokens() { .unwrap(); let stderr_str = std::str::from_utf8(&output.stderr).unwrap().trim(); - eprintln!("{}", stderr_str); + eprintln!("{stderr_str}"); assert!(output.status.success()); @@ -3354,7 +3351,7 @@ async fn test_resolve_dns() { .unwrap(); let err = String::from_utf8_lossy(&output.stderr); let out = String::from_utf8_lossy(&output.stdout); - println!("{}", err); + println!("{err}"); assert!(output.status.success()); assert!(err.starts_with("Check file")); diff --git a/cli/tests/integration/vendor_tests.rs b/cli/tests/integration/vendor_tests.rs index 11fee5686..cd2f7f12e 100644 --- a/cli/tests/integration/vendor_tests.rs +++ b/cli/tests/integration/vendor_tests.rs @@ -530,7 +530,7 @@ fn update_existing_config_test() { } fn success_text(module_count: &str, dir: &str, has_import_map: bool) -> String { - let mut text = format!("Vendored {} into {} directory.", module_count, dir); + let mut text = format!("Vendored {module_count} into {dir} directory."); if has_import_map { let f = format!( concat!( @@ -544,7 +544,7 @@ fn success_text(module_count: &str, dir: &str, has_import_map: bool) -> String { dir.to_string() } ); - write!(text, "{}", f).unwrap(); + write!(text, "{f}").unwrap(); } text } diff --git a/cli/tests/integration/watcher_tests.rs b/cli/tests/integration/watcher_tests.rs index 375bf6804..3f586d812 100644 --- a/cli/tests/integration/watcher_tests.rs +++ b/cli/tests/integration/watcher_tests.rs @@ -74,14 +74,14 @@ fn child_lines( .lines() .map(|r| { let line = r.unwrap(); - eprintln!("STDOUT: {}", line); + eprintln!("STDOUT: {line}"); line }); let stderr_lines = std::io::BufReader::new(child.stderr.take().unwrap()) .lines() .map(|r| { let line = r.unwrap(); - eprintln!("STDERR: {}", line); + eprintln!("STDERR: {line}"); line }); (stdout_lines, stderr_lines) |