mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Fuzzy match in the should parse PostScript numbers
unit-test, to work-around rounding bugs in Chromium browsers
This commit is contained in:
parent
a8dd00876a
commit
57ad3a5acb
1 changed files with 11 additions and 1 deletions
|
@ -99,7 +99,17 @@ describe('parser', function() {
|
|||
for (const number of numbers) {
|
||||
const input = new StringStream(number);
|
||||
const lexer = new Lexer(input);
|
||||
expect(lexer.getNumber()).toEqual(parseFloat(number));
|
||||
|
||||
const result = lexer.getNumber(), expected = parseFloat(number);
|
||||
|
||||
if (result !== expected && Math.abs(result - expected) < 1e-15) {
|
||||
console.error(`Fuzzy matching "${result}" with "${expected}" to ` +
|
||||
'work-around rounding bugs in Chromium browsers.');
|
||||
|
||||
expect(true).toEqual(true);
|
||||
continue;
|
||||
}
|
||||
expect(result).toEqual(expected);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue