From c4771356f27b250e7fdbcede0de5682982720455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 13 Mar 2023 19:31:03 -0400 Subject: refactor: Remove call sites of "deno_core::resolve_url_or_path" (#18169) These call sites didn't need to use "resolve_url_or_path". Towards landing https://github.com/denoland/deno/pull/15454 --- cli/tsc/mod.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'cli/tsc/mod.rs') diff --git a/cli/tsc/mod.rs b/cli/tsc/mod.rs index 2f9b4224c..6add7d1fd 100644 --- a/cli/tsc/mod.rs +++ b/cli/tsc/mod.rs @@ -928,7 +928,7 @@ mod tests { maybe_tsbuildinfo: Option, ) -> OpState { let specifier = maybe_specifier - .unwrap_or_else(|| resolve_url_or_path("file:///main.ts").unwrap()); + .unwrap_or_else(|| ModuleSpecifier::parse("file:///main.ts").unwrap()); let hash_data = maybe_hash_data.unwrap_or_else(|| vec![b"".to_vec()]); let fixtures = test_util::testdata_path().join("tsc2"); let mut loader = MockLoader { fixtures }; @@ -1050,7 +1050,7 @@ mod tests { ("file:///.tsbuildinfo", MediaType::Unknown), ]; for (specifier, media_type) in fixtures { - let specifier = resolve_url_or_path(specifier).unwrap(); + let specifier = ModuleSpecifier::parse(specifier).unwrap(); assert_eq!(get_tsc_media_type(&specifier), media_type); } } @@ -1076,7 +1076,7 @@ mod tests { #[tokio::test] async fn test_load() { let mut state = setup( - Some(resolve_url_or_path("https://deno.land/x/mod.ts").unwrap()), + Some(ModuleSpecifier::parse("https://deno.land/x/mod.ts").unwrap()), None, Some("some content".to_string()), ) @@ -1107,7 +1107,7 @@ mod tests { #[tokio::test] async fn test_load_asset() { let mut state = setup( - Some(resolve_url_or_path("https://deno.land/x/mod.ts").unwrap()), + Some(ModuleSpecifier::parse("https://deno.land/x/mod.ts").unwrap()), None, Some("some content".to_string()), ) @@ -1128,7 +1128,7 @@ mod tests { #[tokio::test] async fn test_load_tsbuildinfo() { let mut state = setup( - Some(resolve_url_or_path("https://deno.land/x/mod.ts").unwrap()), + Some(ModuleSpecifier::parse("https://deno.land/x/mod.ts").unwrap()), None, Some("some content".to_string()), ) @@ -1169,7 +1169,7 @@ mod tests { #[tokio::test] async fn test_resolve() { let mut state = setup( - Some(resolve_url_or_path("https://deno.land/x/a.ts").unwrap()), + Some(ModuleSpecifier::parse("https://deno.land/x/a.ts").unwrap()), None, None, ) @@ -1191,7 +1191,7 @@ mod tests { #[tokio::test] async fn test_resolve_empty() { let mut state = setup( - Some(resolve_url_or_path("https://deno.land/x/a.ts").unwrap()), + Some(ModuleSpecifier::parse("https://deno.land/x/a.ts").unwrap()), None, None, ) @@ -1253,7 +1253,7 @@ mod tests { #[tokio::test] async fn test_exec_basic() { - let specifier = resolve_url_or_path("https://deno.land/x/a.ts").unwrap(); + let specifier = ModuleSpecifier::parse("https://deno.land/x/a.ts").unwrap(); let actual = test_exec(&specifier) .await .expect("exec should not have errored"); @@ -1264,7 +1264,7 @@ mod tests { #[tokio::test] async fn test_exec_reexport_dts() { - let specifier = resolve_url_or_path("file:///reexports.ts").unwrap(); + let specifier = ModuleSpecifier::parse("file:///reexports.ts").unwrap(); let actual = test_exec(&specifier) .await .expect("exec should not have errored"); @@ -1275,7 +1275,7 @@ mod tests { #[tokio::test] async fn fix_lib_ref() { - let specifier = resolve_url_or_path("file:///libref.ts").unwrap(); + let specifier = ModuleSpecifier::parse("file:///libref.ts").unwrap(); let actual = test_exec(&specifier) .await .expect("exec should not have errored"); -- cgit v1.2.3