diff options
Diffstat (limited to 'test/test_precedence_of.ml')
| -rw-r--r-- | test/test_precedence_of.ml | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/test/test_precedence_of.ml b/test/test_precedence_of.ml index 23c26c2..e2e8540 100644 --- a/test/test_precedence_of.ml +++ b/test/test_precedence_of.ml @@ -524,6 +524,60 @@ let test_all_souls_beats_an_ordinary_sunday () = Alcotest.(check bool) "All Souls, not the Sunday, is observed" true (resolution.Precedence.observed = all_souls_candidate) +(* W3 (of-known-wrongs, 2026-08-26). Mary, Mother of the Church (Easter+50) + and a fixed obligatory memorial (e.g. Anthony of Padua, 13 June) both + used to band at Tabula III.10 (100) whenever they coincide -- a tie + {!Rite_of.Precedence_of.band} could not break, silently resolved instead + by {!Colitur_kernel.Precedence.resolve}'s own generic alphabetical + tie-break. See {!Rite_of.Precedence_of.movable_bvm_memorials}'s own + comment for the primary source (the CDWDS's own 24 March 2018 + Notification) this fix cites: the Marian memorial now bands at 95 and + always prevails. This is the direct unit-level counterpart to + test_rite_of.ml's own end-to-end + [test_mater_ecclesiae_anthony_tie_2011_resolved] -- this one calls + {!Colitur_kernel.Precedence.resolve} directly, the same shape every + other test in this file uses, and checks BOTH real years the sweep in + this task's own report found (2011 for Mater Ecclesiae, 2015 for the + Immaculate Heart -- three years apart via the other offset, colliding + with the SAME rival, Anthony of Padua, both confirmed via + {!Colitur_kernel.Computus.gregorian_easter} rather than trusted). *) +let test_movable_bvm_memorial_beats_a_fixed_one () = + let anthony = + mk ~slug:"anthony-of-padua-priest-and-doctor" ~rank:Vocab_of.Memoria_obligatoria + ~origin:Precedence.Sanctoral () + in + List.iter + (fun (label, slug, easter_offset, year, expected_date) -> + let movable = + mk ~slug ~rank:Vocab_of.Memoria_obligatoria ~subject:Subject.Bvm + ~origin:Precedence.Sanctoral () + in + Alcotest.(check bool) + (Printf.sprintf "%s: alphabetically \"anthony-of-padua...\" sorts BEFORE %S -- confirms this \ + test exercises the tie-break the fix overrides, not a vacuous check" + label slug) + true (String.compare "anthony-of-padua-priest-and-doctor" slug < 0); + let easter = Computus.gregorian_easter year in + let d = Date.add_days easter easter_offset in + Alcotest.(check string) + (Printf.sprintf "%s: Easter+%d %d really is %s" label easter_offset year expected_date) + expected_date (Date.to_iso8601 d); + let temporal_c = + mk ~slug:"of-ordinary-time-feria" ~rank:Vocab_of.Feria ~origin:Precedence.Temporal () + in + let ctx = { Precedence.date = d; season = Vocab_of.Ordinary_time; weekday = Date.weekday d } in + let resolution = + Precedence.resolve Rite_of.Precedence_of.rules ctx ~temporal:temporal_c + ~sanctoral:[ anthony; movable ] + in + Alcotest.(check bool) + (Printf.sprintf "%s prevails over Anthony of Padua, not the alphabetical order" label) + true (resolution.Precedence.observed = movable)) + [ ("Mary, Mother of the Church vs Anthony of Padua", "mary-mother-of-the-church", 50, 2011, + "2011-06-13"); + ("Immaculate Heart of Mary vs Anthony of Padua", "immaculate-heart-of-mary", 69, 2015, + "2015-06-13") ] + let suite = ( "precedence-of", [ Alcotest.test_case "Tabula part I (entries 1-4)" `Quick test_part1; @@ -549,5 +603,9 @@ let suite = test_target_is_free_of_entries_1_to_8; Alcotest.test_case "fix round 2: shipped All Souls beats an ordinary per-annum Sunday (2025-11-02)" `Quick - test_all_souls_beats_an_ordinary_sunday ] + test_all_souls_beats_an_ordinary_sunday; + Alcotest.test_case + "W3: a movable BVM obligatory memorial beats a fixed one, per the CDWDS's 24 March 2018 \ + Notification" `Quick + test_movable_bvm_memorial_beats_a_fixed_one ] @ List.map QCheck_alcotest.to_alcotest [ prop_band_total ] ) |
