OLD | NEW |
1 Test the Encoding API's 'fatal' flag | 1 This is a testharness.js-based test. |
| 2 PASS Fatal flag: utf-8 - invalid code |
| 3 PASS Fatal flag: utf-8 - ends early |
| 4 PASS Fatal flag: utf-8 - invalid trail |
| 5 PASS Fatal flag: utf-8 - invalid trail |
| 6 PASS Fatal flag: utf-8 - ends early |
| 7 PASS Fatal flag: utf-8 - invalid trail |
| 8 PASS Fatal flag: utf-8 - invalid trail |
| 9 PASS Fatal flag: utf-8 - invalid trail |
| 10 PASS Fatal flag: utf-8 - invalid trail |
| 11 PASS Fatal flag: utf-8 - > 0x10FFFF |
| 12 PASS Fatal flag: utf-8 - obsolete lead byte |
| 13 PASS Fatal flag: utf-8 - overlong U+0000 - 2 bytes |
| 14 PASS Fatal flag: utf-8 - overlong U+0000 - 3 bytes |
| 15 PASS Fatal flag: utf-8 - overlong U+0000 - 4 bytes |
| 16 PASS Fatal flag: utf-8 - overlong U+0000 - 5 bytes |
| 17 PASS Fatal flag: utf-8 - overlong U+0000 - 6 bytes |
| 18 PASS Fatal flag: utf-8 - overlong U+007F - 2 bytes |
| 19 PASS Fatal flag: utf-8 - overlong U+007F - 3 bytes |
| 20 PASS Fatal flag: utf-8 - overlong U+007F - 4 bytes |
| 21 PASS Fatal flag: utf-8 - overlong U+007F - 5 bytes |
| 22 PASS Fatal flag: utf-8 - overlong U+007F - 6 bytes |
| 23 PASS Fatal flag: utf-8 - overlong U+07FF - 3 bytes |
| 24 PASS Fatal flag: utf-8 - overlong U+07FF - 4 bytes |
| 25 PASS Fatal flag: utf-8 - overlong U+07FF - 5 bytes |
| 26 PASS Fatal flag: utf-8 - overlong U+07FF - 6 bytes |
| 27 PASS Fatal flag: utf-8 - overlong U+FFFF - 4 bytes |
| 28 PASS Fatal flag: utf-8 - overlong U+FFFF - 5 bytes |
| 29 PASS Fatal flag: utf-8 - overlong U+FFFF - 6 bytes |
| 30 PASS Fatal flag: utf-8 - overlong U+10FFFF - 5 bytes |
| 31 PASS Fatal flag: utf-8 - overlong U+10FFFF - 6 bytes |
| 32 PASS Fatal flag: utf-8 - lead surrogate |
| 33 PASS Fatal flag: utf-8 - trail surrogate |
| 34 PASS Fatal flag: utf-8 - surrogate pair |
| 35 PASS Fatal flag: utf-16le - truncated code unit |
| 36 Harness: the test ran to completion. |
2 | 37 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | |
4 | |
5 | |
6 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xC0])) thre
w exception EncodingError: Failed to execute 'decode' on 'TextDecoder': The enco
ded data was not valid.. | |
7 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xC0, 0x00])
) threw exception EncodingError: Failed to execute 'decode' on 'TextDecoder': Th
e encoded data was not valid.. | |
8 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xC0, 0xC0])
) threw exception EncodingError: Failed to execute 'decode' on 'TextDecoder': Th
e encoded data was not valid.. | |
9 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xE0])) thre
w exception EncodingError: Failed to execute 'decode' on 'TextDecoder': The enco
ded data was not valid.. | |
10 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xE0, 0x00])
) threw exception EncodingError: Failed to execute 'decode' on 'TextDecoder': Th
e encoded data was not valid.. | |
11 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xE0, 0xC0])
) threw exception EncodingError: Failed to execute 'decode' on 'TextDecoder': Th
e encoded data was not valid.. | |
12 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xE0, 0x80,
0x00])) threw exception EncodingError: Failed to execute 'decode' on 'TextDecode
r': The encoded data was not valid.. | |
13 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xE0, 0x80,
0xC0])) threw exception EncodingError: Failed to execute 'decode' on 'TextDecode
r': The encoded data was not valid.. | |
14 PASS new TextDecoder('utf-8', {fatal: true}).decode(new Uint8Array([0xFC, 0x80,
0x80, 0x80, 0x80, 0x80])) threw exception EncodingError: Failed to execute 'deco
de' on 'TextDecoder': The encoded data was not valid.. | |
15 PASS new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00])) t
hrew exception EncodingError: Failed to execute 'decode' on 'TextDecoder': The e
ncoded data was not valid.. | |
16 FAIL new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00, 0xd
8])) should throw an exception. Was ���. | |
17 FAIL new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00, 0xd
8, 0x00, 0x00])) should throw an exception. Was ���\0. | |
18 FAIL new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00, 0xd
c, 0x00, 0x00])) should throw an exception. Was ���\0. | |
19 FAIL new TextDecoder('utf-16le', {fatal: true}).decode(new Uint8Array([0x00, 0xd
c, 0x00, 0xd8])) should throw an exception. Was ������. | |
20 PASS successfullyParsed is true | |
21 | |
22 TEST COMPLETE | |
23 | |
OLD | NEW |