1 description("Test resolution of relative UNIX-like URLs.");
4 // Format: [baseURL, relativeURL, expectedURL],
5 // On Unix we fall back to relative behavior since there's nothing else
7 ["http://host/a", "\\\\\\\\Another\\\\path", "http://another/path"],
9 // Even on Windows, we don't allow relative drive specs when the base
11 ["http://host/a", "/c:\\\\foo", "http://host/c:/foo"],
12 ["http://host/a", "//c:\\\\foo", "http://c/foo"],
15 var originalBaseURL
= canonicalize(".");
17 for (var i
= 0; i
< cases
.length
; ++i
) {
18 baseURL
= cases
[i
][0];
19 relativeURL
= cases
[i
][1];
20 expectedURL
= cases
[i
][2];
22 shouldBe("canonicalize('" + relativeURL
+ "')",
23 "'" + expectedURL
+ "'");
26 setBaseURL(originalBaseURL
);