diff options
Diffstat (limited to 'test/test_temporal_of.ml')
| -rw-r--r-- | test/test_temporal_of.ml | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test_temporal_of.ml b/test/test_temporal_of.ml index 7560413..1ccd098 100644 --- a/test/test_temporal_of.ml +++ b/test/test_temporal_of.ml @@ -230,6 +230,28 @@ let test_ferial_slugs () = Alcotest.(check string) "ordinary weekday" "of-ordinary-time-2-monday" (slug_of (d 2026 1 19)); Alcotest.(check string) "lent weekday" "of-lent-6-monday" (slug_of (d 2026 3 30)) +(* R8 fix: a Sunday 24 December must yield the Fourth Sunday of Advent, not + the Vigil -- Tabula I.2/Normae n. 5, and temporal_of.ml's own [named] + comment for the full argument (the same civil-day-granularity reasoning + already applied to Holy Thursday). 2028-12-24 and 2034-12-24 are the two + such Sundays inside the litcal fixture window (2023-12-03..2035-12-01); + 2026-12-24, a Thursday, is the non-Sunday control. *) +let test_nativity_vigil_yields_to_advent_sunday () = + List.iter + (fun (y, label) -> + let dt = d y 12 24 in + Alcotest.(check bool) (label ^ ": 24 Dec is a Sunday") true (D.weekday dt = D.Sun); + Alcotest.(check string) (label ^ ": named claims nothing") "<none>" (named_slug dt); + Alcotest.(check string) (label ^ ": temporal resolves to Advent IV") "of-advent-sunday-4" (slug_of dt); + Alcotest.(check string) (label ^ ": season is still advent") "advent" (season_str dt); + Alcotest.(check (option int)) (label ^ ": week 4") (Some 4) (T.week dt)) + [ (2028, "2028"); (2034, "2034") ]; + (* Non-Sunday 24 December: unaffected, the Vigil still wins. *) + let thu = d 2026 12 24 in + Alcotest.(check bool) "2026: 24 Dec is a Thursday, not a Sunday" true (D.weekday thu <> D.Sun); + Alcotest.(check string) "2026: named still claims the vigil" "of-nativity-vigil" (named_slug thu); + Alcotest.(check string) "2026: temporal still resolves to the vigil" "of-nativity-vigil" (slug_of thu) + let test_colours () = let colour_of dt = (T.temporal dt).Colitur_kernel.Temporal.office.Colitur_kernel.Celebration.colour in Alcotest.(check string) "Good Friday is red" "red" (Colitur_kernel.Colour.to_string (colour_of (d 2026 4 3))); @@ -387,6 +409,7 @@ let suite = Alcotest.test_case "ordinary time resumption" `Quick test_ordinary_time_resumption; Alcotest.test_case "sunday slugs" `Quick test_sunday_slugs; Alcotest.test_case "ferial slugs" `Quick test_ferial_slugs; + Alcotest.test_case "nativity vigil yields to Advent Sunday IV" `Quick test_nativity_vigil_yields_to_advent_sunday; Alcotest.test_case "colours" `Quick test_colours; Alcotest.test_case "domain edges do not raise" `Quick test_domain_edges_do_not_raise; Alcotest.test_case "exhaustive domain sweep" `Slow test_exhaustive_domain_sweep ] |
