diff options
Diffstat (limited to 'test/test_precedence_of.ml')
| -rw-r--r-- | test/test_precedence_of.ml | 57 |
1 files changed, 52 insertions, 5 deletions
diff --git a/test/test_precedence_of.ml b/test/test_precedence_of.ml index e1af486..23c26c2 100644 --- a/test/test_precedence_of.ml +++ b/test/test_precedence_of.ml @@ -405,7 +405,13 @@ let test_annunciation_in_easter_octave () = let test_solemnity_on_a_lenten_sunday () = (* Normae n. 5: a solemnity occurring on a Sunday of Advent, Lent or Easter goes to the FOLLOWING MONDAY, not to a searched free day. 19 March 2028 - (St Joseph) is the Third Sunday of Lent. *) + (St Joseph) is the Third Sunday of Lent, not Palm Sunday -- Rule 0 + (n. 56(f)) does not fire here even with the REAL slug (see the test + right below this one for that), because its own guard is [is_palm_sunday + origin], not merely "this candidate is St Joseph". A synthetic slug is + used deliberately, to keep this test about rule 2's own generic + "solemnity on a privileged Sunday" behaviour, not about St Joseph + specifically. *) let joseph = mk ~slug:"of-joseph" ~rank:Vocab_of.Sollemnitas ~origin:Precedence.Sanctoral () in let target = @@ -413,10 +419,48 @@ let test_solemnity_on_a_lenten_sunday () = Alcotest.(check string) "St Joseph 2028 goes to the following Monday" "2028-03-20" (Date.to_iso8601 target) +(* Normae n. 56(f), Rule 0 -- the one EARLIER-target shape + {!Colitur_kernel.Rite.t.transfer_target}'s relaxed obligation now permits + (rite.mli's own comment carries the argument; W1, + [of-normae-56f], 2026-08-26). Unit-level counterpart to + test_rite_of.ml's own full-Calendar [test_joseph_palm_sunday_2062_ + anticipated_backward] -- this one calls [transfer_target] directly, the + same shape every other test in this file uses, and checks the REAL + shipped slug (unlike [test_solemnity_on_a_lenten_sunday] above, which + uses a placeholder deliberately). Two independent years, not one: 2062 + and 1978 both have Gregorian Easter = 26 March (Palm Sunday = 19 March), + confirmed directly rather than assumed. *) +let test_st_joseph_on_palm_sunday_anticipated_backward () = + let joseph = + mk ~slug:"joseph-husband-of-the-blessed-virgin-mary" ~rank:Vocab_of.Sollemnitas + ~origin:Precedence.Sanctoral () in + List.iter + (fun (palm_sunday, expected_target) -> + let origin = iso palm_sunday in + Alcotest.(check bool) + (Printf.sprintf "%s really is a Sunday (Easter = 26 March that year)" palm_sunday) + true (Date.weekday origin = Date.Sun); + let target = Rite_of.Precedence_of.transfer_target joseph origin occupant in + Alcotest.(check string) + (Printf.sprintf "St Joseph on Palm Sunday %s is anticipated BACKWARD to the preceding Saturday" + palm_sunday) + expected_target (Date.to_iso8601 target); + Alcotest.(check bool) (Printf.sprintf "%s -> earlier than origin, not later" palm_sunday) true + (Date.compare target origin < 0)) + [ ("2062-03-19", "2062-03-18"); ("1978-03-19", "1978-03-18") ] + let test_target_is_strictly_later () = - (* Rite.t.transfer_target's own stated obligation: Calendar treats - target <= origin as a legitimate placement, so a rule that can stand - still would loop candidates in place rather than fail loudly. *) + (* This is the Annunciation's OWN obligation (rules 1-3), not a claim + about {!Rite_of.Precedence_of.transfer_target} as a whole any more -- + {!Colitur_kernel.Rite.t.transfer_target}'s kernel-level obligation was + relaxed from "strictly later" to "different from origin" (W1, + [of-normae-56f], 2026-08-26; see rite.mli's own comment), precisely so + Rule 0 above could return an EARLIER target for St Joseph. The + Annunciation's own three rules are untouched by that relaxation -- + none of them was rewritten, and Calendar's placement pass still treats + [target = origin] as a legitimate (bad) placement for whichever + candidate returns it, so a rule that can stand still would still loop + in place rather than fail loudly. *) List.iter (fun s -> let d = iso s in @@ -496,7 +540,10 @@ let suite = test_annunciation_in_easter_octave; Alcotest.test_case "solemnity on a Lenten Sunday -> following Monday" `Quick test_solemnity_on_a_lenten_sunday; - Alcotest.test_case "transfer_target is always strictly later" `Quick + Alcotest.test_case + "Normae n.56(f), W1: St Joseph on Palm Sunday is anticipated backward to 18 March" `Quick + test_st_joseph_on_palm_sunday_anticipated_backward; + Alcotest.test_case "the Annunciation's own rules 1-3 are always strictly later" `Quick test_target_is_strictly_later; Alcotest.test_case "transfer_target lands free of Tabula entries 1-8" `Quick test_target_is_free_of_entries_1_to_8; |
