Skip to content

Commit

Permalink
test: remove duplicate encoding tests in favor of WPT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
joyeecheung authored and addaleax committed Jan 14, 2019
1 parent da34c6c commit 58de81f
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 303 deletions.
74 changes: 0 additions & 74 deletions test/parallel/test-whatwg-encoding-api-basics.js

This file was deleted.

16 changes: 0 additions & 16 deletions test/parallel/test-whatwg-encoding-custom-fatal-streaming.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const common = require('../common');
if (!common.hasIntl)
common.skip('missing Intl');

const assert = require('assert');

{
[
{ encoding: 'utf-8', sequence: [0xC0] },
Expand All @@ -28,12 +26,6 @@ const assert = require('assert');
`The encoded data was not valid for encoding ${testCase.encoding}`
}
);

// TODO(joyeecheung): remove this when WPT is ported
assert.strictEqual(
new TextDecoder(testCase.encoding).decode(data),
'\uFFFD'
);
});
}

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

// TODO(joyeecheung): remove this when WPT is ported
assert.strictEqual(decoder.decode(odd, { stream: true }), '');
assert.strictEqual(decoder.decode(odd), '\u0000');

common.expectsError(
() => {
decoder.decode(even, { stream: true });
Expand All @@ -69,8 +57,4 @@ const assert = require('assert');
'The encoded data was not valid for encoding utf-16le'
}
);

// TODO(joyeecheung): remove this when WPT is ported
assert.strictEqual(decoder.decode(even, { stream: true }), '\u0000');
assert.strictEqual(decoder.decode(even), '\u0000');
}
10 changes: 0 additions & 10 deletions test/parallel/test-whatwg-encoding-custom-textdecoder-fatal.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const common = require('../common');
if (!common.hasIntl)
common.skip('missing Intl');

const assert = require('assert');

const bad = [
{ encoding: 'utf-8', input: [0xFF], name: 'invalid code' },
{ encoding: 'utf-8', input: [0xC0], name: 'ends early' },
Expand Down Expand Up @@ -82,11 +80,3 @@ bad.forEach((t) => {
}
);
});

// TODO(joyeecheung): remove this when WPT is ported
{
assert('fatal' in new TextDecoder());
assert.strictEqual(typeof new TextDecoder().fatal, 'boolean');
assert(!new TextDecoder().fatal);
assert(new TextDecoder('utf-8', { fatal: true }).fatal);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ const common = require('../common');
if (!common.hasIntl)
common.skip('missing Intl');

const assert = require('assert');

const bad = [
{
encoding: 'utf-16le',
Expand Down Expand Up @@ -44,11 +42,6 @@ const bad = [
];

bad.forEach((t) => {
// TODO(joyeecheung): remove this when WPT is ported
assert.strictEqual(
new TextDecoder(t.encoding).decode(new Uint8Array(t.input)),
t.expected);

common.expectsError(
() => {
new TextDecoder(t.encoding, { fatal: true })
Expand Down
53 changes: 0 additions & 53 deletions test/parallel/test-whatwg-encoding-surrogates-utf8.js

This file was deleted.

44 changes: 0 additions & 44 deletions test/parallel/test-whatwg-encoding-textdecoder-ignorebom.js

This file was deleted.

50 changes: 0 additions & 50 deletions test/parallel/test-whatwg-encoding-textdecoder-streaming.js

This file was deleted.

49 changes: 0 additions & 49 deletions test/parallel/test-whatwg-encoding-textencoder-utf16-surrogates.js

This file was deleted.

0 comments on commit 58de81f

Please sign in to comment.