Skip to content

refactor: work out mermaid cache names and the cache cap from their inputs - #182

Merged
ryanlewis merged 2 commits into
mainfrom
refactor/mermaid-seams
Nov 2, 2026
Merged

ryanlewis merged 2 commits into
mainfrom
refactor/mermaid-seams

Conversation

@ryanlewis

Copy link
Copy Markdown
Owner

No change to what users see. The cache names are unchanged, and the existing pins still pass.

  • name(source, theme) is now a wrapper over name_for(source, theme, renderer). The cache-name pins call name_for with the renderer given, so they no longer depend on the renderer start-up global. A new check: a diagram drawn by mmdc gets a different name.
  • cache_cap() is now a wrapper over cache_cap_from(Option<String>). Tests cover:
    • unset: 100 MiB
    • a valid override, and 0
    • bad values ("", abc, -5, 1.5, " 10", 10MB): these give the default, as today
  • The font test used to skip only when no font file was found. Now it also skips when merman can't load the fonts found, since labels are then measured with merman's estimates and there is nothing to compare. When the fonts load, it also checks that environment() measures with them.

cargo-mutants on name, name_for, Renderer::name, cache_cap, cache_cap_from, environment and merman (-j 2 --timeout 60): 12 mutants, 0 missed. On main, the same functions without the two new ones: 8 mutants, 0 missed.

@ryanlewis
ryanlewis merged commit db085c7 into main Nov 2, 2026
8 checks passed
@ryanlewis
ryanlewis deleted the refactor/mermaid-seams branch November 2, 2026 04:02
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