diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2021-02-17 13:47:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-17 13:47:18 -0500 |
commit | c7dabc99eed50fa20cdcafd7c0175ab615da3d50 (patch) | |
tree | ec2c611c627827bbdd61d3e27400ae1b9a50d459 /runtime/worker.rs | |
parent | f6d6b24506410816833d802e1a8d9cd704f73289 (diff) |
Make ModuleSpecifier a type alias, not wrapper struct (#9531)
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r-- | runtime/worker.rs | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs index a619ecc4c..dca01932d 100644 --- a/runtime/worker.rs +++ b/runtime/worker.rs @@ -260,10 +260,10 @@ impl Drop for MainWorker { #[cfg(test)] mod tests { use super::*; + use deno_core::resolve_url_or_path; fn create_test_worker() -> MainWorker { - let main_module = - ModuleSpecifier::resolve_url_or_path("./hello.js").unwrap(); + let main_module = resolve_url_or_path("./hello.js").unwrap(); let permissions = Permissions::default(); let options = WorkerOptions { @@ -296,8 +296,7 @@ mod tests { .parent() .unwrap() .join("cli/tests/esm_imports_a.js"); - let module_specifier = - ModuleSpecifier::resolve_url_or_path(&p.to_string_lossy()).unwrap(); + let module_specifier = resolve_url_or_path(&p.to_string_lossy()).unwrap(); let mut worker = create_test_worker(); let result = worker.execute_module(&module_specifier).await; if let Err(err) = result { @@ -314,8 +313,7 @@ mod tests { .parent() .unwrap() .join("tests/circular1.js"); - let module_specifier = - ModuleSpecifier::resolve_url_or_path(&p.to_string_lossy()).unwrap(); + let module_specifier = resolve_url_or_path(&p.to_string_lossy()).unwrap(); let mut worker = create_test_worker(); let result = worker.execute_module(&module_specifier).await; if let Err(err) = result { @@ -330,8 +328,7 @@ mod tests { async fn execute_mod_resolve_error() { // "foo" is not a valid module specifier so this should return an error. let mut worker = create_test_worker(); - let module_specifier = - ModuleSpecifier::resolve_url_or_path("does-not-exist").unwrap(); + let module_specifier = resolve_url_or_path("does-not-exist").unwrap(); let result = worker.execute_module(&module_specifier).await; assert!(result.is_err()); } @@ -345,8 +342,7 @@ mod tests { .parent() .unwrap() .join("cli/tests/001_hello.js"); - let module_specifier = - ModuleSpecifier::resolve_url_or_path(&p.to_string_lossy()).unwrap(); + let module_specifier = resolve_url_or_path(&p.to_string_lossy()).unwrap(); let result = worker.execute_module(&module_specifier).await; assert!(result.is_ok()); } |