diff options
Diffstat (limited to 'test/test_lectionary.ml')
| -rw-r--r-- | test/test_lectionary.ml | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/test/test_lectionary.ml b/test/test_lectionary.ml index c6a1cac..a95c98c 100644 --- a/test/test_lectionary.ml +++ b/test/test_lectionary.ml @@ -81,14 +81,55 @@ let test_ef_data_file_loads () = match Lectionary.load "../data/ef/lectionary.sexp" with | Error e -> Alcotest.fail e | Ok l -> - Alcotest.(check int) "entry count" 119 + (* 119 lectio ini sections, translated/widened into colitur's own + Temporal_ef vocabulary (tools/bootstrap_lectionary.ml's own + [colitur_keys]/[vigil_entries]/[derived_entries] comments have the + full account, task 8, branch ef-lectionary): Passiontide's 6 + shared sections each widen into 2 colitur keys (+6); "ef-christmas- + sunday-0" widens into itself PLUS "ef-holy-name-sunday" (+1, a fix + round after the first version replaced rather than widened it and + broke a pre-existing test); one hand-authored entry sourced from + lectio's SANCTORAL calendar, not this lectionary ini + ([ef-nativity-vigil], +1); one entry derived from an + already-translated one rather than re-typed ([ef-holy-name], +1). + 119 + 6 + 1 + 1 + 1 = 128. *) + Alcotest.(check int) "entry count" 128 (List.length (Lectionary.entries l)); (match Lectionary.find l (slug "ef-lent-1-monday") with | Some [ a; b ] -> Alcotest.(check string) "epistle" "Ezech 34:11-16" a.Citation.reference; Alcotest.(check string) "gospel" "Matt 25:31-46" b.Citation.reference | Some _ -> Alcotest.fail "expected exactly two citations" - | None -> Alcotest.fail "ef-lent-1-monday missing") + | None -> Alcotest.fail "ef-lent-1-monday missing"); + (* Task 8's own renamed/derived keys, spot-checked here so a future + regeneration that silently drops one of them fails loudly and + locally, not only via the much bigger differential suite. *) + let check_entry name first gospel = + match Lectionary.find l (slug name) with + | Some [ a; b ] -> + Alcotest.(check string) (name ^ ": epistle") first a.Citation.reference; + Alcotest.(check string) (name ^ ": gospel") gospel b.Citation.reference + | Some _ -> Alcotest.fail (name ^ ": expected exactly two citations") + | None -> Alcotest.fail (name ^ ": missing") + in + check_entry "ef-holy-name-sunday" "Gal 4:1-7" "Luke 2:33-40"; + check_entry "ef-christmas-sunday-0" "Gal 4:1-7" "Luke 2:33-40"; + check_entry "ef-holy-name" "Gal 4:1-7" "Luke 2:33-40"; + check_entry "ef-nativity-vigil" "Rom 1:1-6" "Matt 1:18-21"; + check_entry "ef-pentecost-ember-wed" "Acts 5:12-16" "John 6:44-52."; + check_entry "ef-pentecost-ember-fri" "Joel 2:23-24; 26-27" "Luke 5:17-26"; + check_entry "ef-pentecost-ember-sat" "Rom 5:1-5." "Luke 4:38-44."; + check_entry "ef-passiontide-1-monday" "Jonas 3:1-10" "John 7:32-39"; + check_entry "ef-passiontide-2-monday" "Jonas 3:1-10" "John 7:32-39"; + (* This one MUST be absent: rejected and reverted in the generator's + own [derived_entries] comment -- a regression-net for that + decision, not merely documentation of it. *) + (match Lectionary.find l (slug "ef-nativity-octave-day-6") with + | None -> () + | Some _ -> + Alcotest.fail + "ef-nativity-octave-day-6: must stay absent -- see bootstrap_lectionary.ml's own \ + derived_entries comment for why a direct entry here was tried and reverted") let suite = [ ("find present", `Quick, test_find_present); |
