mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update web-platform-tests to revision 4984b190341b535c645729b8f99247aace0022fe
This commit is contained in:
parent
9ca6768a56
commit
d61756ac9d
73 changed files with 1198 additions and 1135 deletions
|
@ -64,3 +64,17 @@ test(function() {
|
|||
assert_true(new TextDecoder('utf-8', {fatal: true}).fatal, 'The fatal attribute can be set using an option.');
|
||||
|
||||
}, 'The fatal attribute of TextDecoder');
|
||||
|
||||
test(() => {
|
||||
const bytes = new Uint8Array([226, 153, 165]);
|
||||
const decoder = new TextDecoder('utf-8', {fatal: true});
|
||||
assert_equals(decoder.decode(new DataView(bytes.buffer, 0, 3)),
|
||||
'♥',
|
||||
'decode() should decode full sequence');
|
||||
assert_throws(new TypeError,
|
||||
() => decoder.decode(new DataView(bytes.buffer, 0, 2)),
|
||||
'decode() should throw on incomplete sequence');
|
||||
assert_equals(decoder.decode(new DataView(bytes.buffer, 0, 3)),
|
||||
'♥',
|
||||
'decode() should not throw on subsequent call');
|
||||
}, 'Error seen with fatal does not prevent future decodes');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue