Skip to content
Permalink
Browse files

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>
  • Loading branch information...
joyeecheung authored and addaleax committed Jan 2, 2019
1 parent da34c6c commit 58de81faa73335b220e2f9933b09b0e098f346ad

This file was deleted.

@@ -8,8 +8,6 @@ const common = require('../common');
if (!common.hasIntl)
common.skip('missing Intl');

const assert = require('assert');

{
[
{ encoding: 'utf-8', sequence: [0xC0] },
@@ -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'
);
});
}

@@ -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 });
@@ -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');
}
@@ -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' },
@@ -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);
}
@@ -8,8 +8,6 @@ const common = require('../common');
if (!common.hasIntl)
common.skip('missing Intl');

const assert = require('assert');

const bad = [
{
encoding: 'utf-16le',
@@ -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 })

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 58de81f

Please sign in to comment.
You can’t perform that action at this time.