summaryrefslogtreecommitdiff
path: root/cli/file_fetcher.rs
diff options
context:
space:
mode:
authorLuka Hartwig <mail@lukahartwig.de>2020-02-02 22:55:22 +0100
committerGitHub <noreply@github.com>2020-02-02 16:55:22 -0500
commitf168597b7ab81afda3bf4749a81c360d364e7cf1 (patch)
tree4082e9eebf03cc7b3b653822c52a54a62e308d15 /cli/file_fetcher.rs
parente8df66c12cbb3e51f8776aa91e6db41bbfdcae5e (diff)
Remove //tests symlink (#3849)
Diffstat (limited to 'cli/file_fetcher.rs')
-rw-r--r--cli/file_fetcher.rs92
1 files changed, 51 insertions, 41 deletions
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs
index c89166509..d4698e233 100644
--- a/cli/file_fetcher.rs
+++ b/cli/file_fetcher.rs
@@ -1005,7 +1005,7 @@ mod tests {
let fetcher_1 = fetcher.clone();
let fetcher_2 = fetcher.clone();
let module_url =
- Url::parse("http://localhost:4545/tests/subdir/mod2.ts").unwrap();
+ Url::parse("http://localhost:4545/cli/tests/subdir/mod2.ts").unwrap();
let module_url_1 = module_url.clone();
let module_url_2 = module_url.clone();
let headers_file_name = fetcher.deps_cache.location.join(
@@ -1106,7 +1106,8 @@ mod tests {
let (temp_dir, fetcher) = test_setup();
let fetcher_1 = fetcher.clone();
let module_url =
- Url::parse("http://localhost:4545/tests/subdir/mismatch_ext.ts").unwrap();
+ Url::parse("http://localhost:4545/cli/tests/subdir/mismatch_ext.ts")
+ .unwrap();
let module_url_1 = module_url.clone();
let module_url_2 = module_url.clone();
let headers_file_name = fetcher.deps_cache.location.join(
@@ -1183,7 +1184,7 @@ mod tests {
let http_server_guard = crate::test_util::http_server();
let (_temp_dir, fetcher) = test_setup();
let specifier = ModuleSpecifier::resolve_url(
- "http://localhost:4545/tests/subdir/mismatch_ext.ts",
+ "http://localhost:4545/cli/tests/subdir/mismatch_ext.ts",
)
.unwrap();
let headers_file_name = fetcher.deps_cache.location.join(
@@ -1231,22 +1232,24 @@ mod tests {
let http_server_guard = crate::test_util::http_server();
let (_temp_dir, fetcher) = test_setup();
- let redirect_module_url =
- Url::parse("http://localhost:4546/tests/subdir/redirects/redirect1.js")
- .unwrap();
+ let redirect_module_url = Url::parse(
+ "http://localhost:4546/cli/tests/subdir/redirects/redirect1.js",
+ )
+ .unwrap();
let redirect_source_filepath = fetcher
.deps_cache
.location
- .join("http/localhost_PORT4546/tests/subdir/redirects/redirect1.js");
+ .join("http/localhost_PORT4546/cli/tests/subdir/redirects/redirect1.js");
let redirect_source_filename =
redirect_source_filepath.to_str().unwrap().to_string();
- let target_module_url =
- Url::parse("http://localhost:4545/tests/subdir/redirects/redirect1.js")
- .unwrap();
+ let target_module_url = Url::parse(
+ "http://localhost:4545/cli/tests/subdir/redirects/redirect1.js",
+ )
+ .unwrap();
let redirect_target_filepath = fetcher
.deps_cache
.location
- .join("http/localhost_PORT4545/tests/subdir/redirects/redirect1.js");
+ .join("http/localhost_PORT4545/cli/tests/subdir/redirects/redirect1.js");
let redirect_target_filename =
redirect_target_filepath.to_str().unwrap().to_string();
@@ -1263,7 +1266,7 @@ mod tests {
fetcher.get_source_code_headers(&redirect_module_url);
assert_eq!(
redirect_source_headers.redirect_to.unwrap(),
- "http://localhost:4545/tests/subdir/redirects/redirect1.js"
+ "http://localhost:4545/cli/tests/subdir/redirects/redirect1.js"
);
// The target of redirection is downloaded instead.
assert_eq!(
@@ -1286,29 +1289,32 @@ mod tests {
fn test_get_source_code_4() {
let http_server_guard = crate::test_util::http_server();
let (_temp_dir, fetcher) = test_setup();
- let double_redirect_url =
- Url::parse("http://localhost:4548/tests/subdir/redirects/redirect1.js")
- .unwrap();
+ let double_redirect_url = Url::parse(
+ "http://localhost:4548/cli/tests/subdir/redirects/redirect1.js",
+ )
+ .unwrap();
let double_redirect_path = fetcher
.deps_cache
.location
- .join("http/localhost_PORT4548/tests/subdir/redirects/redirect1.js");
+ .join("http/localhost_PORT4548/cli/tests/subdir/redirects/redirect1.js");
- let redirect_url =
- Url::parse("http://localhost:4546/tests/subdir/redirects/redirect1.js")
- .unwrap();
+ let redirect_url = Url::parse(
+ "http://localhost:4546/cli/tests/subdir/redirects/redirect1.js",
+ )
+ .unwrap();
let redirect_path = fetcher
.deps_cache
.location
- .join("http/localhost_PORT4546/tests/subdir/redirects/redirect1.js");
+ .join("http/localhost_PORT4546/cli/tests/subdir/redirects/redirect1.js");
- let target_url =
- Url::parse("http://localhost:4545/tests/subdir/redirects/redirect1.js")
- .unwrap();
+ let target_url = Url::parse(
+ "http://localhost:4545/cli/tests/subdir/redirects/redirect1.js",
+ )
+ .unwrap();
let target_path = fetcher
.deps_cache
.location
- .join("http/localhost_PORT4545/tests/subdir/redirects/redirect1.js");
+ .join("http/localhost_PORT4545/cli/tests/subdir/redirects/redirect1.js");
// Test double redirects and headers recording
let fut = fetcher
@@ -1353,18 +1359,20 @@ mod tests {
let http_server_guard = crate::test_util::http_server();
let (_temp_dir, fetcher) = test_setup();
- let double_redirect_url =
- Url::parse("http://localhost:4548/tests/subdir/redirects/redirect1.js")
- .unwrap();
+ let double_redirect_url = Url::parse(
+ "http://localhost:4548/cli/tests/subdir/redirects/redirect1.js",
+ )
+ .unwrap();
- let redirect_url =
- Url::parse("http://localhost:4546/tests/subdir/redirects/redirect1.js")
- .unwrap();
+ let redirect_url = Url::parse(
+ "http://localhost:4546/cli/tests/subdir/redirects/redirect1.js",
+ )
+ .unwrap();
let target_path = fetcher
.deps_cache
.location
- .join("http/localhost_PORT4545/tests/subdir/redirects/redirect1.js");
+ .join("http/localhost_PORT4545/cli/tests/subdir/redirects/redirect1.js");
let target_path_ = target_path.clone();
// Test that redirect target is not downloaded twice for different redirect source.
@@ -1406,9 +1414,10 @@ mod tests {
fn test_get_source_code_6() {
let http_server_guard = crate::test_util::http_server();
let (_temp_dir, fetcher) = test_setup();
- let double_redirect_url =
- Url::parse("http://localhost:4548/tests/subdir/redirects/redirect1.js")
- .unwrap();
+ let double_redirect_url = Url::parse(
+ "http://localhost:4548/cli/tests/subdir/redirects/redirect1.js",
+ )
+ .unwrap();
// Test that redirections can be limited
let fut = fetcher
@@ -1432,7 +1441,7 @@ mod tests {
let http_server_guard = crate::test_util::http_server();
let (_temp_dir, fetcher) = test_setup();
let module_url =
- Url::parse("http://localhost:4545/tests/002_hello.ts").unwrap();
+ Url::parse("http://localhost:4545/cli/tests/002_hello.ts").unwrap();
// Remote modules are not allowed
let fut = fetcher
.get_source_file_async(&module_url, true, true, false)
@@ -1453,7 +1462,7 @@ mod tests {
let fetcher_1 = fetcher.clone();
let fetcher_2 = fetcher.clone();
let module_url =
- Url::parse("http://localhost:4545/tests/002_hello.ts").unwrap();
+ Url::parse("http://localhost:4545/cli/tests/002_hello.ts").unwrap();
let module_url_1 = module_url.clone();
let module_url_2 = module_url.clone();
// file hasn't been cached before
@@ -1485,7 +1494,7 @@ mod tests {
let http_server_guard = crate::test_util::http_server();
let (_temp_dir, fetcher) = test_setup();
let module_url =
- Url::parse("http://127.0.0.1:4545/tests/subdir/mt_video_mp2t.t3.ts")
+ Url::parse("http://127.0.0.1:4545/cli/tests/subdir/mt_video_mp2t.t3.ts")
.unwrap();
let headers_file_name = fetcher.deps_cache.location.join(
fetcher
@@ -1528,7 +1537,7 @@ mod tests {
let (_temp_dir, fetcher) = test_setup();
let module_url =
- Url::parse("http://localhost:4545/tests/subdir/mt_video_mp2t.t3.ts")
+ Url::parse("http://localhost:4545/cli/tests/subdir/mt_video_mp2t.t3.ts")
.unwrap();
let headers_file_name = fetcher.deps_cache.location.join(
fetcher
@@ -1574,12 +1583,13 @@ mod tests {
let fetcher_2 = fetcher.clone();
let fetcher_3 = fetcher.clone();
let module_url =
- Url::parse("http://localhost:4545/tests/subdir/no_ext").unwrap();
+ Url::parse("http://localhost:4545/cli/tests/subdir/no_ext").unwrap();
let module_url_2 =
- Url::parse("http://localhost:4545/tests/subdir/mismatch_ext.ts").unwrap();
+ Url::parse("http://localhost:4545/cli/tests/subdir/mismatch_ext.ts")
+ .unwrap();
let module_url_2_ = module_url_2.clone();
let module_url_3 =
- Url::parse("http://localhost:4545/tests/subdir/unknown_ext.deno")
+ Url::parse("http://localhost:4545/cli/tests/subdir/unknown_ext.deno")
.unwrap();
let module_url_3_ = module_url_3.clone();