Skip to content

test(dsl): cover unparseable emoji glyph and linked inline-SVG on a wrapped line#223

Merged
DemchaAV merged 1 commit into
developfrom
test/inline-svg-emoji-edge-coverage
Jun 22, 2026
Merged

test(dsl): cover unparseable emoji glyph and linked inline-SVG on a wrapped line#223
DemchaAV merged 1 commit into
developfrom
test/inline-svg-emoji-edge-coverage

Conversation

@DemchaAV

Copy link
Copy Markdown
Owner

Why

Two lenient/edge paths on the inline-SVG + emoji surface had no direct test:

  • EmojiLibrary.find() returns empty — and require() reports "indexed but its
    glyph could not be rendered" — when an indexed shortcode's glyph fails to
    parse, but only the unknown-shortcode and absent-set paths were covered.
  • The linked inline-SVG annotation geometry (spanLinkRectangle) was asserted
    only for a single-line paragraph; the wrapped-line case (icon not on the first
    line) was untested.

What changed

  • EmojiLibraryTest.indexedGlyphThatCannotBeParsedResolvesEmptyAndRequireExplains
    — a URLClassLoader set whose index points at an unrenderable glyph (an SVG
    with no drawable geometry); asserts find() is empty (text fallback) and
    require() 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,InlineSvgRenderTestBUILD
SUCCESS
(EmojiLibraryTest 8, InlineSvgRenderTest 10). Test-only change, no
production code touched.

Lane: test — coverage for existing inline-SVG / emoji behaviour.

Independent of any open branch.

…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.
@DemchaAV DemchaAV merged commit c24257d into develop Jun 22, 2026
11 checks passed
@DemchaAV DemchaAV deleted the test/inline-svg-emoji-edge-coverage branch June 22, 2026 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant