2 * Test for unassigned code points in IDNs (RFC 3454 section 7)
9 function expected_pass(inputIDN) {
11 var displayIDN = idnService.convertToDisplayIDN(inputIDN, isASCII);
12 Assert.equal(displayIDN, inputIDN);
15 function expected_fail(inputIDN) {
20 displayIDN = idnService.convertToDisplayIDN(inputIDN, isASCII);
23 Assert.notEqual(displayIDN, inputIDN);
27 idnService = Cc["@mozilla.org/network/idn-service;1"].getService(
31 // assigned code point
32 expected_pass("foo\u0101bar.com");
34 // assigned code point in punycode. Should *fail* because the URL will be
35 // converted to Unicode for display
36 expected_fail("xn--foobar-5za.com");
38 // unassigned code point
39 expected_fail("foo\u3040bar.com");
41 // unassigned code point in punycode. Should *pass* because the URL will not
42 // be converted to Unicode
43 expected_pass("xn--foobar-533e.com");
45 // code point assigned since Unicode 3.0
46 // XXX This test will unexpectedly pass when we update to IDNAbis
47 expected_fail("foo\u0370bar.com");