diff options
Diffstat (limited to 'test/test_sanctoral_ef.ml')
| -rw-r--r-- | test/test_sanctoral_ef.ml | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/test/test_sanctoral_ef.ml b/test/test_sanctoral_ef.ml index e3b34a6..2024dc2 100644 --- a/test/test_sanctoral_ef.ml +++ b/test/test_sanctoral_ef.ml @@ -7,6 +7,7 @@ module L = Colitur_kernel.Layer module Cel = Colitur_kernel.Celebration +module Citation = Colitur_kernel.Citation module S = Colitur_kernel.Slug module DS = Colitur_kernel.Date_spec module Col = Colitur_kernel.Colour @@ -138,6 +139,26 @@ let test_spot_check_commemoration () = Alcotest.(check (option string)) "name.pl" (Some "św. Maura, Opata") (Names.find cel.Cel.names (Lang.of_string_exn "pl")) +(* Task 3: sanctoral propers land on Celebration.citations, not a second + lectionary-shaped file -- see the bootstrap tool's own reasoning. *) +let test_sanctoral_carries_propers () = + let l = load () in + let e = find l "commemoration-of-the-baptism-of-the-lord" in + let refs = List.map (fun c -> c.Citation.reference) e.L.cel.Cel.citations in + Alcotest.(check (list string)) + "13 January carries its proper Epistle and Gospel" + [ "Isa 60:1-6"; "John 1:29-34" ] refs + +let test_commemoration_only_has_no_readings () = + let l = load () in + let bad = + List.filter + (fun e -> e.L.cel.Cel.status = Cel.Commemoration_only && e.L.cel.Cel.citations <> []) + l.L.entries + in + Alcotest.(check int) + "a commemoration contributes an oration, not a reading" 0 (List.length bad) + let suite = ( "Sanctoral_ef (data/ef/sanctoral.sexp)", [ Alcotest.test_case "load succeeds and counts match the source INI" `Quick @@ -145,4 +166,8 @@ let suite = Alcotest.test_case "spot-check: explicit class = lord (Purification of the BVM)" `Quick test_spot_check_explicit_class; Alcotest.test_case "spot-check: rank = commemoration (St. Maur, Abbot)" `Quick - test_spot_check_commemoration ] ) + test_spot_check_commemoration; + Alcotest.test_case "sanctoral entries carry their proper readings" `Quick + test_sanctoral_carries_propers; + Alcotest.test_case "Commemoration_only entries carry no readings" `Quick + test_commemoration_only_has_no_readings ] ) |
