| 1383 | test('a value with many distinct percent-encodings decodes the same with and without an invalid sequence', () => { |
| 1384 | // A value that is valid percent-encoded UTF-8 is decoded by the built-in decoder. Adding one invalid sequence makes it throw, and the value is then decoded the lenient way instead. Both paths have to give the same characters, so this covers a value with thousands of distinct escapes going through the lenient path. |
| 1385 | const percentByte = value => `%${value.toString(16).toUpperCase().padStart(2, '0')}`; |
| 1386 | |
| 1387 | // Distinct three-byte sequences. Lead bytes 0xE0 and 0xED are left out, because they only allow part of the second-byte range: below 0xA0, 0xE0 begins an overlong encoding, and above 0x9F, 0xED begins a surrogate. Every second byte the loop below makes is then valid. |
| 1388 | const runs = []; |
no outgoing calls
no test coverage detected