tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_unEscapeURIForUI.js (596B)


      1 // Tests for nsITextToSubURI.unEscapeURIForUI
      2 function run_test() {
      3  // Tests whether incomplete multibyte sequences throw.
      4  const tests = [
      5    {
      6      input: "http://example.com/?p=%E3%80%82",
      7      //TODO: should be the same as input, bug 1248812
      8      expected: "http://example.com/?p=%u3002",
      9    },
     10    {
     11      input: "http://example.com/?name=%E3%80%82",
     12      dontEscape: true,
     13      expected: "http://example.com/?name=\u3002",
     14    },
     15  ];
     16 
     17  for (const t of tests) {
     18    Assert.equal(
     19      Services.textToSubURI.unEscapeURIForUI(t.input, t.dontEscape),
     20      t.expected
     21    );
     22  }
     23 }