aboutsummaryrefslogtreecommitdiff
path: root/test/test_names.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-12 11:38:35 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-12 11:38:35 +0200
commite19adb9c7ea369cafe76e7eff50e9248a4a954d0 (patch)
tree57824e121606286ebdf8fff68439986dd3300eae /test/test_names.ml
parent0506388da160a15ceddb0cea1a697d737103d5c4 (diff)
parent36df2bd0af9a555a09334e14b0d89118be1dbbc0 (diff)
downloadcolitur-e19adb9c7ea369cafe76e7eff50e9248a4a954d0.tar.gz
colitur-e19adb9c7ea369cafe76e7eff50e9248a4a954d0.zip
Merge branch 'ef-plan3': Plan 3, the EF resolution engine
Adds the rite-parameterised Precedence resolver, Liturgical_day, Rite, and Calendar (year as the primitive, because transfers need whole-year knowledge), the full EF precedence ruleset (RG 91's 28-entry table, occurrence RG 92-95, commemorations RG 108-111, transfers RG 96-98), 322 bootstrapped sanctoral entries, colitur day <year>, and validation layers 3-5. Layer 3 diffs 16801 days against lectio; layer 4 diffs 730 days against missalemeum; layer 5 pins ~30 dates on the known-tricky years. Both comparison layers carry cited allow-lists that name the governing RG paragraph and which engine is right. The oracle layer earned its place immediately: Holy Thursday was violet in colitur and lectio alike, because colitur's data was bootstrapped from lectio and both carried the same error. Only an independent source could see it. RG 128(b) and RG 122 name it white.
Diffstat (limited to 'test/test_names.ml')
-rw-r--r--test/test_names.ml15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_names.ml b/test/test_names.ml
index 809d1c0..cef7357 100644
--- a/test/test_names.ml
+++ b/test/test_names.ml
@@ -111,6 +111,20 @@ let test_celebration () =
let sexp = Cel.sexp_of_t sexp_of_demo_rank c in
Alcotest.(check bool) "sexp roundtrip" true (Cel.t_of_sexp demo_rank_of_sexp sexp = c)
+let test_celebration_status () =
+ let c =
+ Cel.make ~slug:(S.of_string_exn "telesphorus") ~rank:High ~colour:Col.Red
+ ~subject:Sub.Saint ~layer:"tridentine" ()
+ in
+ Alcotest.(check bool) "defaults to Feast" true (c.Cel.status = Cel.Feast);
+ let k =
+ Cel.make ~slug:(S.of_string_exn "hyginus") ~rank:High ~colour:Col.Red
+ ~status:Cel.Commemoration_only ~subject:Sub.Saint ~layer:"tridentine" ()
+ in
+ Alcotest.(check bool) "explicit status" true (k.Cel.status = Cel.Commemoration_only);
+ let sexp = Cel.sexp_of_t sexp_of_demo_rank k in
+ Alcotest.(check bool) "sexp roundtrip" true (Cel.t_of_sexp demo_rank_of_sexp sexp = k)
+
module Rec = Colitur_kernel.Record
module Voc = Colitur_kernel.Vocab
module Tmp = Colitur_kernel.Temporal
@@ -174,4 +188,5 @@ let suite =
Alcotest.test_case "date_spec sexp roundtrip" `Quick test_date_spec_sexp_roundtrip;
Alcotest.test_case "date_spec sexp validates" `Quick test_date_spec_sexp_validates;
Alcotest.test_case "celebration" `Quick test_celebration;
+ Alcotest.test_case "celebration status" `Quick test_celebration_status;
Alcotest.test_case "record" `Quick test_record ] )