Skip to content

Commit 2e974e8

Browse files
authored
Merge pull request #20109 from maettuu/reg-test-pr-19639
Add regression test for PR 19639
2 parents 995f070 + ac8757f commit 2e974e8

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

test/unit/evaluator_spec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,4 +423,30 @@ describe("evaluator", function () {
423423
expect(operatorList.length).toEqual(0);
424424
});
425425
});
426+
427+
describe("graphics-state operators", function () {
428+
it("should convert negative line width to absolute value in the graphic state", async function () {
429+
const gState = new Dict();
430+
gState.set("LW", -5);
431+
const extGState = new Dict();
432+
extGState.set("GSneg", gState);
433+
434+
const resources = new ResourcesMock();
435+
resources.ExtGState = extGState;
436+
437+
const stream = new StringStream("/GSneg gs");
438+
const result = await runOperatorListCheck(
439+
partialEvaluator,
440+
stream,
441+
resources
442+
);
443+
444+
expect(result.fnArray).toEqual([OPS.setGState]);
445+
446+
const stateEntries = result.argsArray[0][0];
447+
const lwEntry = stateEntries.find(([key]) => key === "LW");
448+
expect(lwEntry).toBeDefined();
449+
expect(lwEntry[1]).toEqual(5);
450+
});
451+
});
426452
});

0 commit comments

Comments
 (0)