diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 15:13:37 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-20 15:13:37 +0200 |
| commit | ec70286daa72fd2a2a78a1cbab0fe2c268e5c743 (patch) | |
| tree | 99f515e44b88778360be599c5d987e458a58718a /tools | |
| parent | a2cbb6b85e79fbc59b0879362c0f853757d51c07 (diff) | |
| download | colitur-ec70286daa72fd2a2a78a1cbab0fe2c268e5c743.tar.gz colitur-ec70286daa72fd2a2a78a1cbab0fe2c268e5c743.zip | |
feat(citation): default_spelling, and close two test gaps
Book.default_spelling returns the first registered spelling for an id. It
is the fallback display name, and it exists because the alternative is
worse: a language file's [bible] lookup is total and returns THE KEY on a
miss, so a book with no entry would render as "luke.abbr 5:12-14".
Falling back to the data's own spelling makes it render as "Luke
5:12-14" instead -- what colitur printed before this feature existed.
The degraded case is the old behaviour, the same principle Lang states
for its own key-returning misses.
Two test gaps closed, both found by mutation rather than by reading:
Parse's split_book scans a leading ordinal digit over '1'..'4', and no
case in the suite used an ordinal above 1. Narrowing the range to
'1'..'3' passed every test while seven real citations depend on it
("3 Kings 17:8-16", "4 Kings 5:1-15"). Parse-layer cases added; the
first attempt at this test asserted through Book.of_token, which is a
table lookup and never reaches split_book at all.
default_spelling is asserted to round-trip: every cited id's fallback
spelling must itself resolve back to that id, or Render and Parse
disagree the moment a book goes unnamed.
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions
