mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
[XFA] Fix an hidden issue in the FormCalc lexer
Since there are no script engine with XFA, the FormCalc parser is not used irl. The bug @nmtigor noticed was hidden by another one (the wrong check on `match`).
This commit is contained in:
parent
8dd2b48488
commit
f5b835157b
2 changed files with 5 additions and 3 deletions
|
@ -22,8 +22,10 @@ describe("FormCalc expression parser", function () {
|
|||
describe("FormCalc lexer", function () {
|
||||
it("should lex numbers", function () {
|
||||
const lexer = new Lexer(
|
||||
"12 1.2345 .7 .12345 1e-2 1.2E+3 1e2 1.2E3 nan 12. 2.e3 infinity 99999999999999999 123456789.012345678 9e99999"
|
||||
"1 7 12 1.2345 .7 .12345 1e-2 1.2E+3 1e2 1.2E3 nan 12. 2.e3 infinity 99999999999999999 123456789.012345678 9e99999"
|
||||
);
|
||||
expect(lexer.next()).toEqual(new Token(TOKEN.number, 1));
|
||||
expect(lexer.next()).toEqual(new Token(TOKEN.number, 7));
|
||||
expect(lexer.next()).toEqual(new Token(TOKEN.number, 12));
|
||||
expect(lexer.next()).toEqual(new Token(TOKEN.number, 1.2345));
|
||||
expect(lexer.next()).toEqual(new Token(TOKEN.number, 0.7));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue