aboutsummaryrefslogtreecommitdiff
path: root/test/test_validate.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_validate.ml')
-rw-r--r--test/test_validate.ml15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/test_validate.ml b/test/test_validate.ml
index 8e63a1b..8c96f26 100644
--- a/test/test_validate.ml
+++ b/test/test_validate.ml
@@ -16,6 +16,7 @@ module T = Rite_ef.Temporal_ef
let sanctoral_path = "../data/ef/sanctoral.sexp"
let adjustments_path = "../data/ef/adjustments.sexp"
let lectionary_path = "../data/ef/lectionary.sexp"
+let commons_path = "../data/ef/commons.sexp"
(* Loaded once at module init, not per call: [run] below is called by every
test and by the 200-sample property, and Calendar.year's own resolution
@@ -42,7 +43,19 @@ let real_ef_lectionary =
| Error e -> failwith (Printf.sprintf "%s: failed to load: %s" lectionary_path e)
| Ok l -> l
-let real_ef_rite = Rite_ef.context ~lectionary:real_ef_lectionary
+(* The Commons (data/ef/commons.sexp) travel the same caller-supplied seam
+ as the lectionary above, and [~commons] is required rather than defaulted
+ so that no caller can silently run with none -- nothing in layers 3-5
+ compares reading citations, so a rite quietly missing its Commons would
+ be invisible. Loaded here even where this file asserts nothing about
+ readings, so that the rite under test is the same one bin/main.ml
+ assembles. *)
+let real_ef_commons =
+ match Rite_ef.Lectionary_ef.Commons.load commons_path with
+ | Error e -> failwith (Printf.sprintf "%s: failed to load: %s" commons_path e)
+ | Ok c -> c
+
+let real_ef_rite = Rite_ef.context ~lectionary:real_ef_lectionary ~commons:real_ef_commons
let run year = Val.run real_ef_rite real_ef_layer ~year