1description("Test URLs that have an anchor."); 2 3cases = [ 4 ["hello, world", "hello, world"], 5 ["\xc2\xa9", "\xc2\xa9"], 6 ["\ud800\udf00ss", "\ud800\udf00ss"], 7 ["%41%a", "%41%a"], 8 ["\\ud800\\u597d", "\\uFFFD\\u597D"], 9 ["a\\uFDD0", "a\\uFDD0"], 10 ["asdf#qwer", "asdf#qwer"], 11 ["#asdf", "#asdf"], 12 ["a\\nb\\rc\\td", "abcd"], 13]; 14 15for (var i = 0; i < cases.length; ++i) { 16 shouldBe("canonicalize('http://www.example.com/#" + cases[i][0] + "')", 17 "'http://www.example.com/#" + cases[i][1] + "'"); 18} 19 20var successfullyParsed = true; 21