test(dsl): cover unparseable emoji glyph and linked inline-SVG on a wrapped line#223
Merged
Merged
Conversation
…rapped line - EmojiLibraryTest: a set whose index points at an unrenderable glyph (an SVG with no drawable geometry). find() stays empty so callers fall back to text, and require() reports "indexed but could not be rendered" — the lenient resolver's previously-uncovered branch. - InlineSvgRenderTest: a linked inline SVG that wraps onto a later line; the click annotation still hugs the icon box, exercising spanLinkRectangle's alignment/height geometry off the paragraph's first line.
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
Two lenient/edge paths on the inline-SVG + emoji surface had no direct test:
EmojiLibrary.find()returns empty — andrequire()reports "indexed but itsglyph could not be rendered" — when an indexed shortcode's glyph fails to
parse, but only the unknown-shortcode and absent-set paths were covered.
spanLinkRectangle) was assertedonly for a single-line paragraph; the wrapped-line case (icon not on the first
line) was untested.
What changed
EmojiLibraryTest.indexedGlyphThatCannotBeParsedResolvesEmptyAndRequireExplains— a
URLClassLoaderset whose index points at an unrenderable glyph (an SVGwith no drawable geometry); asserts
find()is empty (text fallback) andrequire()throws "could not be rendered".InlineSvgRenderTest.linkedInlineSvgOnAWrappedLineKeepsTheAnnotationSizedToTheIcon— a long label forces the linked icon onto a wrapped line (≥2 lines via the
layout graph); the click annotation's height still equals the icon size,
proving the rectangle hugs the icon, not the taller line box.
Verification
./mvnw test -pl . -Dtest=EmojiLibraryTest,InlineSvgRenderTest→ BUILDSUCCESS (
EmojiLibraryTest8,InlineSvgRenderTest10). Test-only change, noproduction code touched.
Lane: test — coverage for existing inline-SVG / emoji behaviour.
Independent of any open branch.