diff options
| -rw-r--r-- | test/test_rite_ef.ml | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/test/test_rite_ef.ml b/test/test_rite_ef.ml index 7b60718..bfc97dc 100644 --- a/test/test_rite_ef.ml +++ b/test/test_rite_ef.ml @@ -1,7 +1,13 @@ (* Coordinator review (Task 11 fix round): integration tests wiring [Rite_ef.context] together with the REAL data/ef/sanctoral.sexp + data/ef/adjustments.sexp through [Colitur_kernel.Calendar] -- the same - pipeline `colitur day` uses, proven here at the OCaml level. *) + pipeline `colitur day` uses, proven here at the OCaml level so these + properties are pinned by the test suite, not merely observable in CLI + output (which is exactly what finding 3 flagged: with the overlay's one + directive replaced by [()], `colitur day 2026`'s stdout is byte-identical + for all 365 days, since [ef-nativity-vigil] always outranks + [vigil-of-christmas] regardless -- the suppression's only observable + effect is on [Liturgical_day.omitted], which no cram assertion reads). *) module Cal = Colitur_kernel.Calendar module Layer = Colitur_kernel.Layer @@ -20,6 +26,8 @@ module V = Rite_ef.Vocab_ef let sanctoral_path = "../data/ef/sanctoral.sexp" let adjustments_path = "../data/ef/adjustments.sexp" +let mk y m d = match Date.make ~year:y ~month:m ~day:d with Ok t -> t | Error e -> failwith e + let real_layer () = let layer = match Layer.load V.rank_of_sexp sanctoral_path with @@ -38,6 +46,42 @@ let real_layer () = let slug_of (c : V.rank Cel.t) = Slug.to_string c.Cel.slug +(* Finding 3: the suppression's ONLY observable effect is on 24 December's + [omitted] (and, belt-and-braces, on every OTHER field of every OTHER day + too -- vigil-of-christmas must not surface anywhere at all, since the + overlay removes it from the layer before resolution ever runs, unlike an + ordinary occurrence loss). Mutation-verified (see the task report): + substituting `(directives ())` for the real overlay makes this test's + first assertion fail (24 December's [omitted] gains + "vigil-of-christmas"), and confirmed the whole cram suite (test/cli.t) + still passes under that same mutation -- so this closes the "removing + the deliverable breaks no test" gap the coordinator flagged, which cram + alone structurally cannot. *) +let test_vigil_of_christmas_suppressed () = + let layer = real_layer () in + let days = Cal.year Rite_ef.context layer 2026 in + let christmas_eve = + Array.to_list days |> List.find (fun d -> Date.compare d.LD.date (mk 2026 12 24) = 0) + in + Alcotest.(check string) "ef-nativity-vigil is still the observed day" "ef-nativity-vigil" + (slug_of christmas_eve.LD.observed); + Alcotest.(check (list string)) + "24 December has nothing omitted -- vigil-of-christmas never enters the RG91 contest at all" + [] + (List.map (fun (c, _) -> slug_of c) christmas_eve.LD.omitted); + let appears_anywhere = + Array.to_list days + |> List.exists (fun d -> + let is_it c = slug_of c = "vigil-of-christmas" in + is_it d.LD.observed + || List.exists (fun (c, _) -> is_it c) d.LD.commemorations + || List.exists (fun (c, _) -> is_it c) d.LD.omitted + || (match d.LD.transferred_in with Some c -> is_it c | None -> false) + || List.exists (fun (c, _) -> is_it c) d.LD.transferred_out) + in + Alcotest.(check bool) "vigil-of-christmas appears NOWHERE in the resolved year" false + appears_anywhere + (* Coordinator review, finding 2, reproduced through the project's OWN extension path (an overlay), the same way the reviewer found it: adding an I-class feast on 25 December (competing against, and losing to, the @@ -77,5 +121,7 @@ let test_transfer_search_does_not_raise_at_domain_ceiling () = let suite = ( "Rite_ef (real data: overlay-in-effect, domain-ceiling)", - [ Alcotest.test_case "RG96 search does not raise at the domain ceiling (real data)" `Quick + [ Alcotest.test_case "the overlay suppression is observably in effect" `Quick + test_vigil_of_christmas_suppressed; + Alcotest.test_case "RG96 search does not raise at the domain ceiling (real data)" `Quick test_transfer_search_does_not_raise_at_domain_ceiling ] ) |
