summaryrefslogtreecommitdiff
path: root/test/test_view.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 10:39:47 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-20 10:39:47 +0200
commit1935f40c156563c134f87093bf6ec8da1cf4fc46 (patch)
tree28e26f391c2b7c034e680b3e46d8dadb000ef7e3 /test/test_view.ml
parentcd46163fa347bbc49bf8008d70d408f62feabda5 (diff)
downloadcolitur-1935f40c156563c134f87093bf6ec8da1cf4fc46.tar.gz
colitur-1935f40c156563c134f87093bf6ec8da1cf4fc46.zip
fix(naming): the rite prints its display name, not the internal id ef
The booklet's title page and running header read "Ordo 2027 . ef" -- an internal identifier reaching a reader, the same defect class the sanctoral/temporal slugs were already fixed for. lang/la.ini and lang/en.ini each gain a [rite] section mapping the rite id to a reader-facing name, sourced from the Missal's own title page (docs/research/LT.txt:6 "MISSALE ROMANUM", :15 "EDITIO TYPICA") plus the 1962 dating this project uses throughout (rules-register.md, CLAUDE.md) -- both cited in the ini comments, marked PATTERN since the phrase combines two title-page elements rather than quoting one verbatim heading. Lang.t gains a rite table/lookup (same total, miss-echoes-the-key contract as every other lookup here); View.of_days exposes rite_name alongside the existing rite field, which stays the stable key exactly as slug is kept beside name. Every shipped template that printed {{rite}} now prints {{rite_name}} instead. test_lang_coverage.ml gains a coverage assertion over every rite id the engine can emit -- one today -- so a second rite module (OF) landing without a matching [rite] entry fails loudly instead of printing its own bare id. Goldens regenerated through the Test_view.view_of path test_render_golden.ml itself uses (English with a Latin fallback), not the CLI (whose --lang default is plain Latin and would have pinned output the tests never produce). test/cli.t's own JSON prefix assertion updated to match: rite_name is a real new key in that generic view dump, sitting right after rite.
Diffstat (limited to 'test/test_view.ml')
-rw-r--r--test/test_view.ml9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/test_view.ml b/test/test_view.ml
index b49b090..e8de6a0 100644
--- a/test/test_view.ml
+++ b/test/test_view.ml
@@ -66,6 +66,11 @@ let as_bool = function T.Bool b -> b | _ -> Alcotest.fail "expected a bool"
let test_year_shape () =
let v = view_of 2027 in
Alcotest.(check string) "rite" "ef" (as_str (get [ "rite" ] v));
+ (* Defect 1: [rite] stays the stable key ("ef"); [rite_name] is the
+ reader-facing display name a template prints instead. en.ini's own
+ [rite] section names it directly. *)
+ Alcotest.(check string) "rite_name" "Roman Missal, 1962 typical edition"
+ (as_str (get [ "rite_name" ] v));
Alcotest.(check string) "year" "2027" (as_str (get [ "year" ] v));
Alcotest.(check int) "twelve months" 12 (List.length (as_list (get [ "months" ] v)));
Alcotest.(check int) "365 days" 365 (List.length (as_list (get [ "days" ] v)))
@@ -193,7 +198,9 @@ let test_vocabularies_localise () =
let d1 = List.hd (as_list (get [ "days" ] v)) in
Alcotest.(check string) "weekday" "Feria VI" (as_str (get [ "weekday" ] d1));
Alcotest.(check string) "rank" "I classis" (as_str (get [ "rank_name" ] d1));
- Alcotest.(check string) "colour" "albus" (as_str (get [ "colour_name" ] d1))
+ Alcotest.(check string) "colour" "albus" (as_str (get [ "colour_name" ] d1));
+ Alcotest.(check string) "rite_name" "Missale Romanum, editio typica 1962"
+ (as_str (get [ "rite_name" ] v))
let suite =
( "View",