Skip to content

Refactor tests - #10

Merged
assaron merged 5 commits into
mainfrom
refactor/tests
Jul 23, 2026
Merged

Refactor tests#10
assaron merged 5 commits into
mainfrom
refactor/tests

Conversation

@assaron

@assaron assaron commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

No description provided.

assaron and others added 5 commits July 23, 2026 11:26
mascarade vendors ggforce's labelboxGrob() and stamped its grobs with
ggforce's 'mark_label' class string, while its own widthDetails/
heightDetails methods were never registered in NAMESPACE. Sizing
therefore dispatched to ggforce's identically-named methods by
coincidence of the shared string -- and would have silently fallen back
to widthDetails.default had ggforce renamed the class or dropped them.

Give the grob its own class and register the methods with
@exportS3Method, so mascarade's label boxes are sized by mascarade's own
code. Also silences the unregistered-S3-method warnings newly emitted by
roxygen2 8.0.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NCXs2e4Vw5asEG3MouXLW
Rework the test helpers and placement/fancyMask tests for readability and
determinism:

- Rewrite helper-score.R to the project style (descriptive names, braces,
  roxygen); split fixture construction/loading into helper-fixtures.R.
- Freeze the placement geometry into fixtures/placement_geom.rds instead
  of rebuilding it via generateMask() at test time, so the tests no longer
  depend on spatstat/polylabelr drift. The box-fit R-tree is an external
  pointer that cannot be serialised, so the fixture stores plain data and
  restorePlacementGeom() rebuilds the tree on load.
- Use the shipped exampleMaskTable (via exampleMask()) in the colour/label
  tests rather than calling generateMask() per case (~15.7s -> ~5.4s).
- Add make-placement-fixtures.R to regenerate the geometry and golden
  scores; gate the golden with an explicit length tolerance via
  expectNoWorseThan().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NCXs2e4Vw5asEG3MouXLW
@assaron
assaron merged commit 8961719 into main Jul 23, 2026
6 checks passed
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