blob: 13674471f85004ec13531de16b936e27e2193274 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script src="resources/utilities.js"></script>
</head>
<body>
<script>
description("Test basic features of URL segmentation");
cases = [
// [URL, [SCHEME, HOST, PORT, PATH, QUERY, REF]]
["http://example.com/", ["http:", "example.com", "", "/", "", ""]],
];
var originalBaseURL = canonicalize(".");
setBaseURL("http://example.org/foo/bar");
for (var i = 0; i < cases.length; ++i) {
shouldBe("segments('" + cases[i][0] + "')",
"'" + JSON.stringify(cases[i][1]) + "'");
}
setBaseURL(originalBaseURL);
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>