aboutsummaryrefslogtreecommitdiff
path: root/test/test_temporal_ef.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-11 13:16:26 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-11 13:16:26 +0200
commit3c3e84a6ebd4d2a9bcd81410d4a2e5c2fa51005d (patch)
tree20a6a77ac20d839f0cf433cf71327013cd39d081 /test/test_temporal_ef.ml
parentfffae3b3cb50b1cf7d5b65eb592bfa1de2ed0e1c (diff)
downloadcolitur-3c3e84a6ebd4d2a9bcd81410d4a2e5c2fa51005d.tar.gz
colitur-3c3e84a6ebd4d2a9bcd81410d4a2e5c2fa51005d.zip
rite(ef): season boundaries per RG 71-77
Christmas Time runs to 13 January inclusive (RG 72-73) and time after Epiphany opens on 14 January (RG 77), diverging from lectio, which starts time-after-epiphany at 6 January. Holy Saturday stays in Passiontide: the Easter Vigil is a night Mass, and a per-day calendar assigns a date by the season governing its day-hours.
Diffstat (limited to 'test/test_temporal_ef.ml')
-rw-r--r--test/test_temporal_ef.ml39
1 files changed, 38 insertions, 1 deletions
diff --git a/test/test_temporal_ef.ml b/test/test_temporal_ef.ml
index f7851c1..eb672d9 100644
--- a/test/test_temporal_ef.ml
+++ b/test/test_temporal_ef.ml
@@ -22,7 +22,44 @@ let test_slug_words () =
(V.season_slug_word V.Christmastide);
Alcotest.(check string) "season name differs" "paschaltide" (V.season_to_string V.Paschaltide)
+module T = Rite_ef.Temporal_ef
+module D = Colitur_kernel.Date
+
+let d y m dd = match D.make ~year:y ~month:m ~day:dd with
+ | Ok t -> t | Error e -> Alcotest.failf "%s" e
+
+let season_str dt = V.season_to_string (T.season dt)
+
+let test_advent_start () =
+ (* Advent 2026 begins Sunday 29 November 2026. *)
+ Alcotest.(check string) "advent 2026" "2026-11-29" (D.to_iso8601 (T.advent_start 2026));
+ Alcotest.(check bool) "always a Sunday" true (D.weekday (T.advent_start 2026) = D.Sun)
+
+let test_seasons () =
+ (* Easter 2026 is 5 April. *)
+ Alcotest.(check string) "1 Dec 2026" "advent" (season_str (d 2026 12 1));
+ Alcotest.(check string) "24 Dec 2026" "advent" (season_str (d 2026 12 24));
+ Alcotest.(check string) "25 Dec 2026" "christmastide" (season_str (d 2026 12 25));
+ (* RG 72-73: Christmas Time runs to 13 January INCLUSIVE -- the deliberate
+ divergence from lectio, which starts time-after-epiphany at 6 January. *)
+ Alcotest.(check string) "6 Jan 2026" "christmastide" (season_str (d 2026 1 6));
+ Alcotest.(check string) "13 Jan 2026" "christmastide" (season_str (d 2026 1 13));
+ Alcotest.(check string) "14 Jan 2026" "time-after-epiphany" (season_str (d 2026 1 14));
+ Alcotest.(check string) "Septuagesima 1 Feb 2026" "septuagesima" (season_str (d 2026 2 1));
+ Alcotest.(check string) "Ash Wed 18 Feb 2026" "lent" (season_str (d 2026 2 18));
+ Alcotest.(check string) "Passion Sun 22 Mar 2026" "passiontide" (season_str (d 2026 3 22));
+ (* Holy Saturday stays in Passiontide: the Vigil is a night Mass (spec ยง4.2). *)
+ Alcotest.(check string) "Holy Sat 4 Apr 2026" "passiontide" (season_str (d 2026 4 4));
+ Alcotest.(check string) "Easter 5 Apr 2026" "paschaltide" (season_str (d 2026 4 5));
+ Alcotest.(check string) "Sat after Pentecost 30 May 2026" "paschaltide" (season_str (d 2026 5 30));
+ Alcotest.(check string) "Trinity 31 May 2026" "time-after-pentecost" (season_str (d 2026 5 31))
+
+let suite_extra_seasons =
+ [ Alcotest.test_case "advent start" `Quick test_advent_start;
+ Alcotest.test_case "seasons" `Quick test_seasons ]
+
let suite =
( "Rite_ef",
[ Alcotest.test_case "vocab roundtrips" `Quick test_vocab_roundtrips;
- Alcotest.test_case "slug words" `Quick test_slug_words ] )
+ Alcotest.test_case "slug words" `Quick test_slug_words ]
+ @ suite_extra_seasons )