Follow-up of pr #12344

This commit is contained in:
Calixte Denizet 2020-09-09 11:46:02 +02:00
parent e51e9d1f33
commit 64a6efd95e
9 changed files with 69 additions and 56 deletions

View file

@ -18,6 +18,7 @@ import {
getInheritableProperty,
isWhiteSpace,
log2,
parseXFAPath,
toRomanNumerals,
} from "../../src/core/core_utils.js";
import { XRefMock } from "./test_utils.js";
@ -211,4 +212,18 @@ describe("core_utils", function () {
expect(isWhiteSpace(undefined)).toEqual(false);
});
});
describe("parseXFAPath", function () {
it("should get a correctly parsed path", function () {
const path = "foo.bar[12].oof[3].rab.FOO[123].BAR[456]";
expect(parseXFAPath(path)).toEqual([
{ name: "foo", pos: 0 },
{ name: "bar", pos: 12 },
{ name: "oof", pos: 3 },
{ name: "rab", pos: 0 },
{ name: "FOO", pos: 123 },
{ name: "BAR", pos: 456 },
]);
});
});
});