mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
adding missing test cases for <unknown> base (#4988)
This commit is contained in:
parent
8ec36681dd
commit
4bc9c18fe9
1 changed files with 17 additions and 0 deletions
|
@ -213,7 +213,16 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_resolve_import() {
|
fn test_resolve_import() {
|
||||||
|
fn get_path(specifier: &str) -> Url {
|
||||||
|
let base_path = current_dir().unwrap().join("<unknown>");
|
||||||
|
let base_url = Url::from_file_path(base_path).unwrap();
|
||||||
|
base_url.join(specifier).unwrap()
|
||||||
|
}
|
||||||
|
let awesome = get_path("/awesome.ts");
|
||||||
|
let awesome_srv = get_path("/service/awesome.ts");
|
||||||
let tests = vec![
|
let tests = vec![
|
||||||
|
("/awesome.ts", "<unknown>", awesome.as_str()),
|
||||||
|
("/service/awesome.ts", "<unknown>", awesome_srv.as_str()),
|
||||||
(
|
(
|
||||||
"./005_more_imports.ts",
|
"./005_more_imports.ts",
|
||||||
"http://deno.land/core/tests/006_url_imports.ts",
|
"http://deno.land/core/tests/006_url_imports.ts",
|
||||||
|
@ -292,6 +301,14 @@ mod tests {
|
||||||
use ModuleResolutionError::*;
|
use ModuleResolutionError::*;
|
||||||
|
|
||||||
let tests = vec![
|
let tests = vec![
|
||||||
|
(
|
||||||
|
"awesome.ts",
|
||||||
|
"<unknown>",
|
||||||
|
ImportPrefixMissing(
|
||||||
|
"awesome.ts".to_string(),
|
||||||
|
Some("<unknown>".to_string()),
|
||||||
|
),
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"005_more_imports.ts",
|
"005_more_imports.ts",
|
||||||
"http://deno.land/core/tests/006_url_imports.ts",
|
"http://deno.land/core/tests/006_url_imports.ts",
|
||||||
|
|
Loading…
Reference in a new issue