test: kill 74 escaped Infection mutants across PDF builder, PNG embedder, font metrics, and compiler#17
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix all issues reported by Infection
test: kill 74 escaped Infection mutants across PDF builder, PNG embedder, font metrics, and compiler
May 29, 2026
f59690f to
3950573
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The last Infection run on PR #16 reported 74 escaped mutants — mutations that were not caught by any test, indicating untested behavioral branches.
Changes
StandardFontMetrics(mutants 65–68)measureStringreturns0.0for empty text with positive font size (killsLogicalOrmutant), for non-empty text withfontSize = 0.0exactly (killsLessThanOrEqualTo), and comparing F3 (Times-Roman) vs. F1/F2 measurements to pin thein_array(['F3','F4'])branch (killsArrayItemRemoval)FilesystemPdfImageEmbedder(mutants 1–55)match($channels)arms$colorRow .=/$alphaRow .=accumulation semantics and$colorScanlines .=/$alphaScanlines .=(killsAssignmentmutants)0(grayscale) and4(grayscale+alpha) to cover thosedescribePngColorTypearms and the soft-mask path for grayscale-alphaAssignmentmutant 39 andBreak_mutant 40)MatchArmRemoval/Throw_mutants 32–33), invalid PNG signature (killsMethodCallRemovalmutant 34), and compression/filter header validation (killsLogicalOrmutant 45)SinglePagePdfExporter(mutants 56–64)formatNumber(killsCastFloatmutant 56)array_mapserialization (killsUnwrapArrayMapmutant 57)"prefix 1 0 R"or"1 0 R suffix"must NOT be treated as a raw PDF reference, to pin both anchors in/^\d+ 0 R$/(killsPregMatchRemoveCaret63 andPregMatchRemoveDollar64)TemplateDocumentBuilder(mutants 69–73)strokeColorset butstrokeWidth = 0.0must not produce a stroke (killsGreaterThanmutant 71);strokeColor = nullwith positivestrokeWidthmust not produce a stroke (killsLogicalAndmutants 69–70)borderRadiuslarger than half the smallest dimension to assert the radius is clamped tomin(w/2, h/2)— catches bothDivision→Multiplicationmutations (mutants 72–73)XObjectTemplateCompiler(mutant 74)HtmlContextInterpolatorinstance and verifying it is wired into the compiler, catching theCoalesceflip mutationOriginal prompt
Created from VS Code.