Merge pull request #20109 from maettuu/reg-test-pr-19639

Add regression test for PR 19639
This commit is contained in:
calixteman 2025-07-28 18:53:24 +02:00 committed by GitHub
commit 2e974e8f30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -423,4 +423,30 @@ describe("evaluator", function () {
expect(operatorList.length).toEqual(0);
});
});
describe("graphics-state operators", function () {
it("should convert negative line width to absolute value in the graphic state", async function () {
const gState = new Dict();
gState.set("LW", -5);
const extGState = new Dict();
extGState.set("GSneg", gState);
const resources = new ResourcesMock();
resources.ExtGState = extGState;
const stream = new StringStream("/GSneg gs");
const result = await runOperatorListCheck(
partialEvaluator,
stream,
resources
);
expect(result.fnArray).toEqual([OPS.setGState]);
const stateEntries = result.argsArray[0][0];
const lwEntry = stateEntries.find(([key]) => key === "LW");
expect(lwEntry).toBeDefined();
expect(lwEntry[1]).toEqual(5);
});
});
});