From 02383b4267600d526f718bb11fcb25cd405e4c9f Mon Sep 17 00:00:00 2001 From: "Node.js GitHub Bot" Date: Mon, 9 Dec 2024 19:36:23 -0500 Subject: [PATCH] test: update WPT for url to 6fa3fe8a92 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/56136 Reviewed-By: Michaƫl Zasso Reviewed-By: Antoine du Hamel --- test/fixtures/wpt/README.md | 2 +- test/fixtures/wpt/url/resources/toascii.json | 173 +++++++++++++++++- test/fixtures/wpt/versions.json | 2 +- .../test-whatwg-url-custom-domainto.js | 2 +- .../test-whatwg-url-toascii.js | 4 +- test/wpt/status/url.json | 16 ++ 6 files changed, 193 insertions(+), 6 deletions(-) rename test/{parallel => known_issues}/test-whatwg-url-custom-domainto.js (96%) rename test/{parallel => known_issues}/test-whatwg-url-toascii.js (97%) diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 8336539a7d70d4..cc97c8787a2c98 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -28,7 +28,7 @@ Last update: - resource-timing: https://github.com/web-platform-tests/wpt/tree/22d38586d0/resource-timing - resources: https://github.com/web-platform-tests/wpt/tree/1e140d63ec/resources - streams: https://github.com/web-platform-tests/wpt/tree/bc9dcbbf1a/streams -- url: https://github.com/web-platform-tests/wpt/tree/67880a4eb8/url +- url: https://github.com/web-platform-tests/wpt/tree/6fa3fe8a92/url - user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi diff --git a/test/fixtures/wpt/url/resources/toascii.json b/test/fixtures/wpt/url/resources/toascii.json index d02c4c7e86654c..6445db80e3c8f3 100644 --- a/test/fixtures/wpt/url/resources/toascii.json +++ b/test/fixtures/wpt/url/resources/toascii.json @@ -1,5 +1,6 @@ [ - "This resource is focused on highlighting issues with UTS #46 ToASCII", + "This contains assorted IDNA tests that IdnaTestV2 might not cover.", + "Feel free to deduplicate with a clear commit message.", { "comment": "Label with hyphens in 3rd and 4th position", "input": "aa--", @@ -198,5 +199,175 @@ { "input": ">\u00AD\u0338", "output": "xn--hdh" + }, + "Tests below are from WebKit (fast/url/idna2003.html & fast/url/idna2008.html; contributed by Chris Weber back in 2011).", + { + "input": "fa\u00DF.de", + "output": "xn--fa-hia.de" + }, + { + "input": "\u03B2\u03CC\u03BB\u03BF\u03C2.com", + "output": "xn--nxasmm1c.com" + }, + { + "input": "\u0DC1\u0DCA\u200D\u0DBB\u0DD3.com", + "output": "xn--10cl1a0b660p.com" + }, + { + "input": "\u0646\u0627\u0645\u0647\u200C\u0627\u06CC.com", + "output": "xn--mgba3gch31f060k.com" + }, + { + "input": "www.loo\u0138out.net", + "output": "www.xn--looout-5bb.net" + }, + { + "input": "\u15EF\u15EF\u15EF.lookout.net", + "output": "xn--1qeaa.lookout.net" + }, + { + "input": "www.lookout.\u0441\u043E\u043C", + "output": "www.lookout.xn--l1adi" + }, + { + "input": "www\u2025lookout.net", + "output": null + }, + { + "input": "www.lookout\u2027net", + "output": "www.xn--lookoutnet-406e" + }, + { + "input": "www.lookout.net\u2A7480", + "output": null + }, + { + "input": "www\u00A0.lookout.net", + "output": null + }, + { + "input": "\u1680lookout.net", + "output": null + }, + { + "input": "\u001flookout.net", + "output": null + }, + { + "input": "look\u06DDout.net", + "output": null + }, + { + "input": "look\u180Eout.net", + "output": null + }, + { + "input": "look\u2060out.net", + "output": "lookout.net" + }, + { + "input": "look\uFEFFout.net", + "output": "lookout.net" + }, + { + "input": "look\uD83F\uDFFEout.net", + "output": null + }, + { + "input": "look\uFFFAout.net", + "output": null + }, + { + "input": "look\u2FF0out.net", + "output": null + }, + { + "input": "look\u0341out.net", + "output": "xn--looout-kp7b.net" + }, + { + "input": "look\u202Eout.net", + "output": null + }, + { + "input": "look\u206Bout.net", + "output": null + }, + { + "input": "look\uDB40\uDC01out.net", + "output": null + }, + { + "input": "look\uDB40\uDC20out.net", + "output": null + }, + { + "input": "look\u05BEout.net", + "output": null + }, + { + "input": "B\u00FCcher.de", + "output": "xn--bcher-kva.de" + }, + { + "input": "\u2665.net", + "output": "xn--g6h.net" + }, + { + "input": "\u0378.net", + "output": null + }, + { + "input": "\u04C0.com", + "output": null + }, + { + "comment": "This is U+2F868 (which is mapped to U+36FC starting with Unicode 16.0)", + "input": "\uD87E\uDC68.com", + "output": "xn--snl.com" + }, + { + "input": "\u2183.com", + "output": null + }, + { + "input": "look\u034Fout.net", + "output": "lookout.net" + }, + { + "input": "gOoGle.com", + "output": "google.com" + }, + { + "input": "\u09dc.com", + "output": "xn--15b8c.com" + }, + { + "input": "\u1E9E.com", + "output": "xn--zca.com" + }, + { + "input": "\u1E9E.foo.com", + "output": "xn--zca.foo.com" + }, + { + "input": "-foo.bar.com", + "output": "-foo.bar.com" + }, + { + "input": "foo-.bar.com", + "output": "foo-.bar.com" + }, + { + "input": "ab--cd.com", + "output": "ab--cd.com" + }, + { + "input": "xn--0.com", + "output": null + }, + { + "input": "foo\u0300.bar.com", + "output": "xn--fo-3ja.bar.com" } ] diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index a3e0dd60ed66ab..2560056dba990d 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -72,7 +72,7 @@ "path": "streams" }, "url": { - "commit": "67880a4eb83ca9aa732eec4b35a1971ff5bf37ff", + "commit": "6fa3fe8a929be45422cd46a8961e647e13d0cab8", "path": "url" }, "user-timing": { diff --git a/test/parallel/test-whatwg-url-custom-domainto.js b/test/known_issues/test-whatwg-url-custom-domainto.js similarity index 96% rename from test/parallel/test-whatwg-url-custom-domainto.js rename to test/known_issues/test-whatwg-url-custom-domainto.js index b7458d7a8e1a86..9e70e34f7095d3 100644 --- a/test/parallel/test-whatwg-url-custom-domainto.js +++ b/test/known_issues/test-whatwg-url-custom-domainto.js @@ -13,7 +13,7 @@ const { domainToASCII, domainToUnicode } = require('url'); const tests = require('../fixtures/url-idna'); const fixtures = require('../common/fixtures'); const wptToASCIITests = require( - fixtures.path('wpt', 'url', 'resources', 'toascii.json') + fixtures.path('wpt', 'url', 'resources', 'toascii.json'), ); { diff --git a/test/parallel/test-whatwg-url-toascii.js b/test/known_issues/test-whatwg-url-toascii.js similarity index 97% rename from test/parallel/test-whatwg-url-toascii.js rename to test/known_issues/test-whatwg-url-toascii.js index e5180bfb344127..0d2485f0d38398 100644 --- a/test/parallel/test-whatwg-url-toascii.js +++ b/test/known_issues/test-whatwg-url-toascii.js @@ -10,8 +10,8 @@ const { test, assert_equals, assert_throws } = require('../common/wpt').harness; const request = { response: require( - fixtures.path('wpt', 'url', 'resources', 'toascii.json') - ) + fixtures.path('wpt', 'url', 'resources', 'toascii.json'), + ), }; // The following tests are copied from WPT. Modifications to them should be diff --git a/test/wpt/status/url.json b/test/wpt/status/url.json index 96dafd91b707d5..d361048874d72d 100644 --- a/test/wpt/status/url.json +++ b/test/wpt/status/url.json @@ -13,6 +13,22 @@ ] } }, + "toascii.window.js": { + "fail": { + "note": "Unicode 15.1", + "expected": [ + "\uD87E\uDC68.com (using URL)", + "\uD87E\uDC68.com (using URL.host)", + "\uD87E\uDC68.com (using URL.hostname)", + "\u1E9E.com (using URL)", + "\u1E9E.com (using URL.host)", + "\u1E9E.com (using URL.hostname)", + "\u1E9E.foo.com (using URL)", + "\u1E9E.foo.com (using URL.host)", + "\u1E9E.foo.com (using URL.hostname)" + ] + } + }, "url-setters-a-area.window.js": { "skip": "already tested in url-setters.any.js" },