Add SVGDraftmanTest — direct visitor tests #9

Closed
opened 2026-03-27 15:01:24 +00:00 by thib8956 · 0 comments
Owner

Priority: P1 — Medium

Context: The existing SVGExporterTest tests the full export pipeline but obscures individual visitor logic. Direct visitor tests provide:

  • Isolation — tests fail at the specific visitor method
  • Faster feedback — no complex shape construction needed
  • Edge case targeting — test specific attribute combinations

Scope: src/main/java/ovh/gasser/newshapes/ui/visitors/SVGDraftman.java

Goal: Test each visit*() method in isolation.

Assertions strategy:

Use Exact Match For Use Contains/Partial For
Element tags (<rect>, <circle>) Dynamic values (coords, colors)
Fixed attributes (xmlns, DOCTYPE) CSS output ordering
Structure markers

Edge cases to cover:

  • Null ColorAttributes
  • Filled only / stroked only / both / neither
  • Empty collection
  • Nested SCollection

Estimate: 2 hours
Dependencies: None

**Priority:** P1 — Medium **Context:** The existing SVGExporterTest tests the full export pipeline but obscures individual visitor logic. Direct visitor tests provide: - **Isolation** — tests fail at the specific visitor method - **Faster feedback** — no complex shape construction needed - **Edge case targeting** — test specific attribute combinations **Scope:** `src/main/java/ovh/gasser/newshapes/ui/visitors/SVGDraftman.java` **Goal:** Test each `visit*()` method in isolation. **Assertions strategy:** | Use Exact Match For | Use Contains/Partial For | |---|---| | Element tags (`<rect>`, `<circle>`) | Dynamic values (coords, colors) | | Fixed attributes (xmlns, DOCTYPE) | CSS output ordering | | Structure markers | | **Edge cases to cover:** - Null ColorAttributes - Filled only / stroked only / both / neither - Empty collection - Nested SCollection **Estimate:** 2 hours **Dependencies:** None
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: thib8956/new-shapes#9