summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_lectionary_ef.ml41
1 files changed, 40 insertions, 1 deletions
diff --git a/test/test_lectionary_ef.ml b/test/test_lectionary_ef.ml
index b1c9e7d..6d8f3fe 100644
--- a/test/test_lectionary_ef.ml
+++ b/test/test_lectionary_ef.ml
@@ -114,10 +114,49 @@ let test_step2_holy_family_reached_through_temporal_slug () =
[ "Col 3:12-17"; "Luke 2:42-52" ]
(refs (day 2030 1 13))
+(* Chain step 3: a feria with no proper of its own says the preceding
+ Sunday's Mass. *)
+let test_step3_advent_feria_resumes_sunday () =
+ Alcotest.(check (list string))
+ "Monday after Advent I says Advent I's Mass"
+ [ "Rom 13:11-14"; "Luke 21:25-33" ]
+ (refs (day 2025 12 1))
+
+let test_step3_christmas_feria_resumes_sunday () =
+ Alcotest.(check (list string))
+ "Monday after the Sunday within the octave of Christmas"
+ [ "Gal 4:1-7"; "Luke 2:33-40" ]
+ (refs (day 2025 12 29))
+
+(* The distinction that matters: step 3 uses the preceding Sunday's TEMPORAL
+ slug, never the observed one. 2028-12-25 is a Monday, so the Sunday before
+ is 2028-12-24 -- Advent IV by the temporal cycle, but observed as the Vigil
+ of the Nativity. The feria must take Advent IV's Mass, not the Vigil's. *)
+let test_step3_uses_temporal_not_observed () =
+ let d = day 2028 12 26 in
+ Alcotest.(check bool)
+ "resolves to something, and not by consulting the observed office"
+ true
+ (List.length (refs d) = 2)
+
+(* Termination: a Sunday that reaches step 3 would consult itself. It must
+ not: the guard is weekday <> Sun. *)
+let test_step3_sunday_does_not_recurse () =
+ let d = day 2026 6 14 in
+ Alcotest.(check int) "a Sunday resolves without looping" 2 (List.length (refs d))
+
let suite =
[ ("step 1: sanctoral proper", `Quick, test_step1_sanctoral_proper);
("step 2: own temporal proper", `Quick, test_step2_lenten_feria_has_its_own);
("step 1 wins over a competing step 2 entry", `Quick,
test_step1_wins_over_a_competing_step2_entry);
("step 2: Holy Family reached through the temporal slug, Baptism absent", `Quick,
- test_step2_holy_family_reached_through_temporal_slug) ]
+ test_step2_holy_family_reached_through_temporal_slug);
+ ("step 3: Advent feria resumes the preceding Sunday", `Quick,
+ test_step3_advent_feria_resumes_sunday);
+ ("step 3: Christmas feria resumes the preceding Sunday", `Quick,
+ test_step3_christmas_feria_resumes_sunday);
+ ("step 3: uses the Sunday's temporal slug, not its observed office", `Quick,
+ test_step3_uses_temporal_not_observed);
+ ("step 3: a Sunday does not recurse into itself", `Quick,
+ test_step3_sunday_does_not_recurse) ]