test: rename custom encoding tests that cannot be replaced by WPT
PR-URL: https://github.com/nodejs/node/pull/25155 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
2b91c2b5ee
commit
05ee814f08
@ -1,6 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// From: https://github.com/w3c/web-platform-tests/blob/d74324b53c/encoding/textdecoder-fatal-streaming.html
|
// From: https://github.com/w3c/web-platform-tests/blob/d74324b53c/encoding/textdecoder-fatal-streaming.html
|
||||||
|
// With the twist that we specifically test for Node.js error codes
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ const assert = require('assert');
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO(joyeecheung): remove this when WPT is ported
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
new TextDecoder(testCase.encoding).decode(data),
|
new TextDecoder(testCase.encoding).decode(data),
|
||||||
'\uFFFD'
|
'\uFFFD'
|
||||||
@ -40,6 +42,7 @@ const assert = require('assert');
|
|||||||
const odd = new Uint8Array([0x00]);
|
const odd = new Uint8Array([0x00]);
|
||||||
const even = new Uint8Array([0x00, 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, { stream: true }), '');
|
||||||
assert.strictEqual(decoder.decode(odd), '\u0000');
|
assert.strictEqual(decoder.decode(odd), '\u0000');
|
||||||
|
|
||||||
@ -67,6 +70,7 @@ const assert = require('assert');
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// TODO(joyeecheung): remove this when WPT is ported
|
||||||
assert.strictEqual(decoder.decode(even, { stream: true }), '\u0000');
|
assert.strictEqual(decoder.decode(even, { stream: true }), '\u0000');
|
||||||
assert.strictEqual(decoder.decode(even), '\u0000');
|
assert.strictEqual(decoder.decode(even), '\u0000');
|
||||||
}
|
}
|
@ -1,6 +1,8 @@
|
|||||||
// Flags: --expose-internals
|
// Flags: --expose-internals
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
// This tests internal mapping of the Node.js encoding implementation
|
||||||
|
|
||||||
require('../common');
|
require('../common');
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
@ -1,4 +1,8 @@
|
|||||||
// Flags: --expose-internals
|
// Flags: --expose-internals
|
||||||
|
|
||||||
|
// This tests interoperability between TextEncoder and TextDecoder with
|
||||||
|
// Node.js util.inspect and Buffer APIs
|
||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const common = require('../common');
|
const common = require('../common');
|
Loading…
x
Reference in New Issue
Block a user