aboutsummaryrefslogtreecommitdiff
path: root/test/test_precedence_ef.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_precedence_ef.ml')
-rw-r--r--test/test_precedence_ef.ml32
1 files changed, 31 insertions, 1 deletions
diff --git a/test/test_precedence_ef.ml b/test/test_precedence_ef.ml
index 084d708..0973a93 100644
--- a/test/test_precedence_ef.ml
+++ b/test/test_precedence_ef.ml
@@ -897,6 +897,34 @@ let test_transfer_target_terminates_under_pathological_occupant () =
true
(D.compare target (D.add_days origin 1000) <= 0)
+(* Coordinator review: [search_from] must not probe [occupant] past
+ {!Date}'s own domain ceiling (31 December 9999). A SYNTHETIC occupant
+ (like [occupant_always_blocking] above) can never actually discriminate
+ this: it never calls [Computus.gregorian_easter] itself, so it cannot
+ raise regardless of whether the domain guard exists -- a test built on
+ one would only prove [search_from]'s unrelated step bound, not this fix.
+ [occupant] here is instead the REAL [Temporal_ef.temporal] (no sanctoral
+ layer needed: 29-31 Dec are ALREADY II class via [named]'s own Nativity-
+ octave-day entries, so three real, unbroken blocking days already sit at
+ the very end of the domain) -- exactly the shape that raises without the
+ fix: 1 January of civil year 10000 is next, and [Computus.gregorian_easter
+ 10000] does [Date.make ~year:10000 ...] and [failwith]s (the .ml's own
+ [domain_max_date] comment; also how the reviewer reproduced the bug
+ through the project's own overlay mechanism -- see the task report for
+ that end-to-end reproduction). Mutation-verified: reverting the domain
+ guard makes this test error with exactly that uncaught [Failure], not
+ merely fail an assertion (see the task report). *)
+let test_transfer_target_does_not_raise_at_domain_ceiling () =
+ let origin = mk 9999 12 28 in
+ let occupant d = (T.temporal d).Colitur_kernel.Temporal.office in
+ let c = cand ~origin:P.Sanctoral ~layer:PE.universal_layer "ef-domain-ceiling-case" in
+ let target = PE.transfer_target c origin occupant in
+ Alcotest.(check bool) "past 31 December 9999 (the guard engaged; nothing admissible remained \
+ in-domain, so the search gave up at the ceiling rather than crashing)"
+ true
+ (D.compare target (mk 9999 12 31) > 0)
+
+
let suite =
( "Precedence_ef",
List.map
@@ -947,4 +975,6 @@ let suite =
"transfer_target: Annunciation exception searches onward if that Monday is blocked" `Quick
test_transfer_target_annunciation_searches_onward_if_blocked;
Alcotest.test_case "transfer_target: terminates and stays forward under a pathological occupant"
- `Quick test_transfer_target_terminates_under_pathological_occupant ] )
+ `Quick test_transfer_target_terminates_under_pathological_occupant;
+ Alcotest.test_case "transfer_target: does not raise probing past the domain ceiling" `Quick
+ test_transfer_target_does_not_raise_at_domain_ceiling ] )