test(shapes): isolate the ShapeContainer outline-fill render surface#201
Merged
Merged
Conversation
ShapeOutlineRenderCoverageTest exercised two of the three surfaces a new ShapeOutline permit must satisfy — the clip path and the inline-shape run. The container's own outline fill/stroke geometry, built by ShapeContainerDefinition's instanceof chain, was only covered transitively through the clip test (the outline fragment is emitted whether or not the container clips). Add everyOutlineFillsAContainerWithoutThrowing, which renders each permit with ClipPolicy.OVERFLOW_VISIBLE so the fill is emitted without a clip, isolating that surface. Mutation-checked: disabling the Path branch in ShapeContainerDefinition fails the fill and clip cases while the inline case (a different handler) stays green.
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.
Why
ShapeOutlineRenderCoverageTestis the exhaustiveness guard that stops a newShapeOutlinepermit from silently missing a render branch. It covered two ofthe three outline-consuming surfaces — the shape-container clip path and the
inline-shape run — but not the container's own outline fill/stroke geometry as
a standalone case. That geometry, built by
ShapeContainerDefinition'sinstanceofchain (ending inIllegalStateException), was only coveredtransitively: the clip test emits the outline fragment whether or not the
container clips, so a missing fill branch would fail it — but the coverage was
implicit and would vanish if the clip surface ever changed.
What changed
Added
everyOutlineFillsAContainerWithoutThrowing, which renders each permitas a container with
ClipPolicy.OVERFLOW_VISIBLE(fill emitted, no clip),isolating the fill surface. Updated the class Javadoc to name all three
surfaces and the
everyPermittedOutlineHasARepresentativehint accordingly.Test-only; no production change.
Verification
./mvnw test -pl .→ BUILD SUCCESS, 1385 tests, 0 failures.ShapeOutline.Pathbranch inShapeContainerDefinitionturns the new fill case AND the clip case red whilethe inline case (a different render handler) stays green — confirming the new
test independently drives the fill chain.
Lane: canonical (
document.architectureguard). No public API change.