Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions test/unit/evaluator_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});