test: use URL fixtures under test/fixtures/wpt/url/resources
Removes the following files: - test/fixtures/url-tests.js - test/fixtures/url-setter-tests.js - test/fixtures/url-toascii.js in favor of: - test/fixtures/wpt/url/resources/urltestdata.json - test/fixtures/wpt/url/resources/setters_tests.json - test/fixtures/wpt/url/resources/toascii.json Also removes dependency of `fixtures/url-tests.js` in http2 tests and use `fixtures/person-large.jpg` instead since they are just looking for a big enough file to transfer. PR-URL: https://github.com/nodejs/node/pull/24035 Refs: https://github.com/nodejs/node/issues/23192 Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
This commit is contained in:
parent
8caade8bb7
commit
1357913180
1874
test/fixtures/url-setter-tests.js
vendored
1874
test/fixtures/url-setter-tests.js
vendored
File diff suppressed because it is too large
Load Diff
6662
test/fixtures/url-tests.js
vendored
6662
test/fixtures/url-tests.js
vendored
File diff suppressed because it is too large
Load Diff
157
test/fixtures/url-toascii.js
vendored
157
test/fixtures/url-toascii.js
vendored
@ -1,157 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
/* The following tests are copied from WPT. Modifications to them should be
|
||||
upstreamed first. Refs:
|
||||
https://github.com/w3c/web-platform-tests/blob/4839a0a804/url/toascii.json
|
||||
License: http://www.w3.org/Consortium/Legal/2008/04-testsuite-copyright.html
|
||||
*/
|
||||
module.exports =
|
||||
[
|
||||
"This resource is focused on highlighting issues with UTS #46 ToASCII",
|
||||
{
|
||||
"comment": "Label with hyphens in 3rd and 4th position",
|
||||
"input": "aa--",
|
||||
"output": "aa--"
|
||||
},
|
||||
{
|
||||
"input": "a†--",
|
||||
"output": "xn--a---kp0a"
|
||||
},
|
||||
{
|
||||
"input": "ab--c",
|
||||
"output": "ab--c"
|
||||
},
|
||||
{
|
||||
"comment": "Label with leading hyphen",
|
||||
"input": "-x",
|
||||
"output": "-x"
|
||||
},
|
||||
{
|
||||
"input": "-†",
|
||||
"output": "xn----xhn"
|
||||
},
|
||||
{
|
||||
"input": "-x.xn--nxa",
|
||||
"output": "-x.xn--nxa"
|
||||
},
|
||||
{
|
||||
"input": "-x.β",
|
||||
"output": "-x.xn--nxa"
|
||||
},
|
||||
{
|
||||
"comment": "Label with trailing hyphen",
|
||||
"input": "x-.xn--nxa",
|
||||
"output": "x-.xn--nxa"
|
||||
},
|
||||
{
|
||||
"input": "x-.β",
|
||||
"output": "x-.xn--nxa"
|
||||
},
|
||||
{
|
||||
"comment": "Empty labels",
|
||||
"input": "x..xn--nxa",
|
||||
"output": "x..xn--nxa"
|
||||
},
|
||||
{
|
||||
"input": "x..β",
|
||||
"output": "x..xn--nxa"
|
||||
},
|
||||
{
|
||||
"comment": "Invalid Punycode",
|
||||
"input": "xn--a",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"input": "xn--a.xn--nxa",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"input": "xn--a.β",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"comment": "Valid Punycode",
|
||||
"input": "xn--nxa.xn--nxa",
|
||||
"output": "xn--nxa.xn--nxa"
|
||||
},
|
||||
{
|
||||
"comment": "Mixed",
|
||||
"input": "xn--nxa.β",
|
||||
"output": "xn--nxa.xn--nxa"
|
||||
},
|
||||
{
|
||||
"input": "ab--c.xn--nxa",
|
||||
"output": "ab--c.xn--nxa"
|
||||
},
|
||||
{
|
||||
"input": "ab--c.β",
|
||||
"output": "ab--c.xn--nxa"
|
||||
},
|
||||
{
|
||||
"comment": "CheckJoiners is true",
|
||||
"input": "\u200D.example",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"input": "xn--1ug.example",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"comment": "CheckBidi is true",
|
||||
"input": "يa",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"input": "xn--a-yoc",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"comment": "processing_option is Nontransitional_Processing",
|
||||
"input": "ශ්රී",
|
||||
"output": "xn--10cl1a0b660p"
|
||||
},
|
||||
{
|
||||
"input": "نامهای",
|
||||
"output": "xn--mgba3gch31f060k"
|
||||
},
|
||||
{
|
||||
"comment": "U+FFFD",
|
||||
"input": "\uFFFD.com",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"comment": "U+FFFD character encoded in Punycode",
|
||||
"input": "xn--zn7c.com",
|
||||
"output": null
|
||||
},
|
||||
{
|
||||
"comment": "Label longer than 63 code points",
|
||||
"input": "x01234567890123456789012345678901234567890123456789012345678901x",
|
||||
"output": "x01234567890123456789012345678901234567890123456789012345678901x"
|
||||
},
|
||||
{
|
||||
"input": "x01234567890123456789012345678901234567890123456789012345678901†",
|
||||
"output": "xn--x01234567890123456789012345678901234567890123456789012345678901-6963b"
|
||||
},
|
||||
{
|
||||
"input": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa",
|
||||
"output": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa"
|
||||
},
|
||||
{
|
||||
"input": "x01234567890123456789012345678901234567890123456789012345678901x.β",
|
||||
"output": "x01234567890123456789012345678901234567890123456789012345678901x.xn--nxa"
|
||||
},
|
||||
{
|
||||
"comment": "Domain excluding TLD longer than 253 code points",
|
||||
"input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.x",
|
||||
"output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.x"
|
||||
},
|
||||
{
|
||||
"input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa",
|
||||
"output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa"
|
||||
},
|
||||
{
|
||||
"input": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.β",
|
||||
"output": "01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.01234567890123456789012345678901234567890123456789.0123456789012345678901234567890123456789012345678.xn--nxa"
|
||||
}
|
||||
]
|
@ -5,7 +5,9 @@ require('../common');
|
||||
const url = require('url');
|
||||
const assert = require('assert');
|
||||
const fixtures = require('../common/fixtures');
|
||||
const tests = require(fixtures.path('url-tests'));
|
||||
const tests = require(
|
||||
fixtures.path('wpt', 'url', 'resources', 'urltestdata.json')
|
||||
);
|
||||
|
||||
let failed = 0;
|
||||
let attempted = 0;
|
||||
|
@ -13,7 +13,7 @@ const path = require('path');
|
||||
|
||||
const tmpdir = require('../common/tmpdir');
|
||||
tmpdir.refresh();
|
||||
const loc = fixtures.path('url-tests.js');
|
||||
const loc = fixtures.path('person-large.jpg');
|
||||
const fn = path.join(tmpdir.path, 'http2-url-tests.js');
|
||||
|
||||
const server = http2.createServer();
|
||||
|
@ -14,7 +14,7 @@ const path = require('path');
|
||||
|
||||
const tmpdir = require('../common/tmpdir');
|
||||
tmpdir.refresh();
|
||||
const loc = fixtures.path('url-tests.js');
|
||||
const loc = fixtures.path('person-large.jpg');
|
||||
const fn = path.join(tmpdir.path, 'http2-url-tests.js');
|
||||
|
||||
const server = http2.createServer();
|
||||
|
@ -13,7 +13,7 @@ const path = require('path');
|
||||
|
||||
const tmpdir = require('../common/tmpdir');
|
||||
tmpdir.refresh();
|
||||
const loc = fixtures.path('url-tests.js');
|
||||
const loc = fixtures.path('person-large.jpg');
|
||||
const fn = path.join(tmpdir.path, 'http2-url-tests.js');
|
||||
|
||||
const server = http2.createServer();
|
||||
|
@ -10,7 +10,10 @@ const icu = internalBinding('icu');
|
||||
const assert = require('assert');
|
||||
|
||||
const tests = require('../fixtures/url-idna.js');
|
||||
const wptToASCIITests = require('../fixtures/url-toascii.js');
|
||||
const fixtures = require('../common/fixtures');
|
||||
const wptToASCIITests = require(
|
||||
fixtures.path('wpt', 'url', 'resources', 'toascii.json')
|
||||
);
|
||||
|
||||
{
|
||||
for (const [i, { ascii, unicode }] of tests.entries()) {
|
||||
|
@ -11,7 +11,9 @@ const { test, assert_equals, assert_true, assert_throws } =
|
||||
require('../common/wpt');
|
||||
|
||||
const request = {
|
||||
response: require(fixtures.path('url-tests'))
|
||||
response: require(
|
||||
fixtures.path('wpt', 'url', 'resources', 'urltestdata.json')
|
||||
)
|
||||
};
|
||||
|
||||
/* The following tests are copied from WPT. Modifications to them should be
|
||||
|
@ -11,7 +11,10 @@ const assert = require('assert');
|
||||
const { domainToASCII, domainToUnicode } = require('url');
|
||||
|
||||
const tests = require('../fixtures/url-idna');
|
||||
const wptToASCIITests = require('../fixtures/url-toascii');
|
||||
const fixtures = require('../common/fixtures');
|
||||
const wptToASCIITests = require(
|
||||
fixtures.path('wpt', 'url', 'resources', 'toascii.json')
|
||||
);
|
||||
|
||||
{
|
||||
const expectedError = common.expectsError(
|
||||
|
@ -12,7 +12,9 @@ const URL = require('url').URL;
|
||||
const assert = require('assert');
|
||||
const fixtures = require('../common/fixtures');
|
||||
|
||||
const tests = require(fixtures.path('url-tests'));
|
||||
const tests = require(
|
||||
fixtures.path('wpt', 'url', 'resources', 'urltestdata.json')
|
||||
);
|
||||
|
||||
const originalFailures = tests.filter((test) => test.failure);
|
||||
|
||||
|
@ -10,7 +10,9 @@ const URL = require('url').URL;
|
||||
const { test, assert_equals } = require('../common/wpt');
|
||||
|
||||
const request = {
|
||||
response: require(fixtures.path('url-tests'))
|
||||
response: require(
|
||||
fixtures.path('wpt', 'url', 'resources', 'urltestdata.json')
|
||||
)
|
||||
};
|
||||
|
||||
/* The following tests are copied from WPT. Modifications to them should be
|
||||
|
@ -11,7 +11,9 @@ const { test, assert_equals } = require('../common/wpt');
|
||||
const fixtures = require('../common/fixtures');
|
||||
|
||||
const request = {
|
||||
response: require(fixtures.path('url-setter-tests'))
|
||||
response: require(fixtures.path(
|
||||
'wpt', 'url', 'resources', 'setters_tests.json'
|
||||
))
|
||||
};
|
||||
|
||||
/* The following tests are copied from WPT. Modifications to them should be
|
||||
|
@ -10,7 +10,9 @@ const { URL } = require('url');
|
||||
const { test, assert_equals, assert_throws } = require('../common/wpt');
|
||||
|
||||
const request = {
|
||||
response: require(fixtures.path('url-toascii'))
|
||||
response: require(
|
||||
fixtures.path('wpt', 'url', 'resources', 'toascii.json')
|
||||
)
|
||||
};
|
||||
|
||||
/* The following tests are copied from WPT. Modifications to them should be
|
||||
|
Loading…
x
Reference in New Issue
Block a user