Skip to content

Commit 58de81f

Browse files
joyeecheungaddaleax
authored andcommitted
test: remove duplicate encoding tests in favor of WPT
PR-URL: #25321 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent da34c6c commit 58de81f

8 files changed

+0
-303
lines changed

test/parallel/test-whatwg-encoding-api-basics.js

-74
This file was deleted.

test/parallel/test-whatwg-encoding-custom-fatal-streaming.js

-16
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const common = require('../common');
88
if (!common.hasIntl)
99
common.skip('missing Intl');
1010

11-
const assert = require('assert');
12-
1311
{
1412
[
1513
{ encoding: 'utf-8', sequence: [0xC0] },
@@ -28,12 +26,6 @@ const assert = require('assert');
2826
`The encoded data was not valid for encoding ${testCase.encoding}`
2927
}
3028
);
31-
32-
// TODO(joyeecheung): remove this when WPT is ported
33-
assert.strictEqual(
34-
new TextDecoder(testCase.encoding).decode(data),
35-
'\uFFFD'
36-
);
3729
});
3830
}
3931

@@ -42,10 +34,6 @@ const assert = require('assert');
4234
const odd = new Uint8Array([0x00]);
4335
const even = new Uint8Array([0x00, 0x00]);
4436

45-
// TODO(joyeecheung): remove this when WPT is ported
46-
assert.strictEqual(decoder.decode(odd, { stream: true }), '');
47-
assert.strictEqual(decoder.decode(odd), '\u0000');
48-
4937
common.expectsError(
5038
() => {
5139
decoder.decode(even, { stream: true });
@@ -69,8 +57,4 @@ const assert = require('assert');
6957
'The encoded data was not valid for encoding utf-16le'
7058
}
7159
);
72-
73-
// TODO(joyeecheung): remove this when WPT is ported
74-
assert.strictEqual(decoder.decode(even, { stream: true }), '\u0000');
75-
assert.strictEqual(decoder.decode(even), '\u0000');
7660
}

test/parallel/test-whatwg-encoding-custom-textdecoder-fatal.js

-10
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const common = require('../common');
88
if (!common.hasIntl)
99
common.skip('missing Intl');
1010

11-
const assert = require('assert');
12-
1311
const bad = [
1412
{ encoding: 'utf-8', input: [0xFF], name: 'invalid code' },
1513
{ encoding: 'utf-8', input: [0xC0], name: 'ends early' },
@@ -82,11 +80,3 @@ bad.forEach((t) => {
8280
}
8381
);
8482
});
85-
86-
// TODO(joyeecheung): remove this when WPT is ported
87-
{
88-
assert('fatal' in new TextDecoder());
89-
assert.strictEqual(typeof new TextDecoder().fatal, 'boolean');
90-
assert(!new TextDecoder().fatal);
91-
assert(new TextDecoder('utf-8', { fatal: true }).fatal);
92-
}

test/parallel/test-whatwg-encoding-custom-textdecoder-utf16-surrogates.js

-7
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ const common = require('../common');
88
if (!common.hasIntl)
99
common.skip('missing Intl');
1010

11-
const assert = require('assert');
12-
1311
const bad = [
1412
{
1513
encoding: 'utf-16le',
@@ -44,11 +42,6 @@ const bad = [
4442
];
4543

4644
bad.forEach((t) => {
47-
// TODO(joyeecheung): remove this when WPT is ported
48-
assert.strictEqual(
49-
new TextDecoder(t.encoding).decode(new Uint8Array(t.input)),
50-
t.expected);
51-
5245
common.expectsError(
5346
() => {
5447
new TextDecoder(t.encoding, { fatal: true })

test/parallel/test-whatwg-encoding-surrogates-utf8.js

-53
This file was deleted.

test/parallel/test-whatwg-encoding-textdecoder-ignorebom.js

-44
This file was deleted.

test/parallel/test-whatwg-encoding-textdecoder-streaming.js

-50
This file was deleted.

test/parallel/test-whatwg-encoding-textencoder-utf16-surrogates.js

-49
This file was deleted.

0 commit comments

Comments
 (0)