Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: fix linting errors
  • Loading branch information
lytovka committed Jun 30, 2025
commit 43fbb04b9ba14f6f251d6a9d00ce5bd0bfcd75c7
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,14 @@ const assert = require('assert');
[0x9C, 0x0153], // LATIN SMALL LIGATURE OE
[0x9D, 0x009D], // UNDEFINED
[0x9E, 0x017E], // LATIN SMALL LETTER Z WITH CARON
[0x9F, 0x0178] // LATIN CAPITAL LETTER Y WITH DIAERESIS
[0x9F, 0x0178], // LATIN CAPITAL LETTER Y WITH DIAERESIS
];

for (let i = 0; i < win1252_0x7F_0x9F.length; i++) {
const byte = win1252_0x7F_0x9F[i][0];
const expectedUnicodeCode = win1252_0x7F_0x9F[i][1];
const arr = new Uint8Array([byte]);
let decoded;
assert.doesNotThrow(() => {
decoded = new TextDecoder("windows-1252").decode(arr);
}, `Decoding byte ${byte} should not throw`);
const decoded = new TextDecoder('windows-1252').decode(arr);
assert.strictEqual(decoded.length, 1, `Decoded string for ${byte} should have length 1`);
const actualUnicodeCode = decoded.codePointAt(0);
assert.strictEqual(actualUnicodeCode, expectedUnicodeCode, `Decoded code point for ${byte} should be U+${expectedUnicodeCode.toString(16).toUpperCase()}`);
Expand Down
Loading