aboutsummaryrefslogtreecommitdiff
path: root/test/test_calendar_of_data.ml
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_calendar_of_data.ml')
-rw-r--r--test/test_calendar_of_data.ml38
1 files changed, 28 insertions, 10 deletions
diff --git a/test/test_calendar_of_data.ml b/test/test_calendar_of_data.ml
index d4f8a8b..9261ebc 100644
--- a/test/test_calendar_of_data.ml
+++ b/test/test_calendar_of_data.ml
@@ -69,14 +69,16 @@ let sha256_of_file path =
don't transcribe it from output" pinning discipline. *)
let test_sha256 () =
Alcotest.(check string) "data/of/calendar-2002.sexp SHA-256"
- "1b4f2117133dea1c70989708d94e6f292f3ce23fce6221391191d6fcf6042d19" (sha256_of_file path)
+ "91479d8b5d92d8e35c2ae34f239d5623a2a59cca2f02d51a8cbbad52edd46b3a" (sha256_of_file path)
(* Counts independently re-derived from the shipped file
- (`grep -c '(slug'`; `grep -oP '(?<=\(rank )[A-Za-z_]+' | sort | uniq -c`).
- 206 = 209 raw table rows minus the 3 dates (1 Jan, 6 Jan, 25 Dec) already
- computed by Temporal_of.named -- see test_excludes_temporal_of_dates
- below, which closes the loop on that exclusion rather than merely
- asserting the count moved. *)
+ (`grep -c '((slug'`; `grep -oP '(?<=\(rank )[A-Za-z_]+' | sort | uniq -c`).
+ 208 = 209 raw FIXED-date table rows minus the 3 dates (1 Jan, 6 Jan, 25
+ Dec) already computed by Temporal_of.named (see
+ test_excludes_temporal_of_dates below, which closes the loop on that
+ exclusion) PLUS the 2 movable entries fix round 1 added (Sacred Heart
+ of Jesus, Immaculate Heart of Mary -- see test_movable_entries): 209 -
+ 3 + 2 = 208. *)
let test_load_and_counts () =
let l = load () in
Alcotest.(check int) "208 entries" 208 (List.length l.L.entries);
@@ -92,7 +94,19 @@ let test_load_and_counts () =
Alcotest.(check int) "208 Feast (OF admits no Commemoration_only status)" 208
(count (fun e -> e.L.cel.Cel.status = Cel.Feast));
Alcotest.(check int) "every entry tagged Precedence_of.universal_layer" 208
- (count (fun e -> e.L.cel.Cel.layer = PO.universal_layer))
+ (count (fun e -> e.L.cel.Cel.layer = PO.universal_layer));
+ (* Fix round 2: classify_subject's "maria"/"b.m.v" SUBSTRING heuristic
+ over-matched 12 saints who merely carry "Maria" in their own name
+ (Maximilian Mary Kolbe, John Mary Vianney, Mary Magdalene, ...) as
+ Bvm -- replaced with an explicit BVM_DATES table of the 13 genuinely
+ Marian entries (12 fixed + the movable Immaculate Heart of Mary).
+ Pinned here so a regression to the old substring rule -- or a new one
+ with the same failure shape -- reddens immediately rather than only
+ showing up if/when a future Subject.Bvm-keyed rule is added. *)
+ Alcotest.(check int) "13 Bvm (12 fixed + Immaculate Heart of Mary)" 13
+ (count (fun e -> e.L.cel.Cel.subject = Sub.Bvm));
+ Alcotest.(check int) "9 Lord" 9 (count (fun e -> e.L.cel.Cel.subject = Sub.Lord));
+ Alcotest.(check int) "186 Saint" 186 (count (fun e -> e.L.cel.Cel.subject = Sub.Saint))
let test_slugs_unique () =
let l = load () in
@@ -109,9 +123,13 @@ let test_slugs_revalidate () =
| Error msg -> Alcotest.failf "slug %s failed re-validation: %s" (S.to_string e.L.cel.Cel.slug) msg)
l.L.entries
-(* Every date is a Fixed month/day; DS.fixed already rejects an out-of-range
- day against the leap-year maximum, so this also proves no entry claims a
- nonexistent day (e.g. 30 February). *)
+(* Every FIXED-date entry's month/day pair already went through DS.fixed,
+ which rejects an out-of-range day against the leap-year maximum, so
+ resolving every entry (fixed AND the 2 movable Easter_offset ones, via
+ DS.resolve's own Easter_offset branch) in a real leap year also proves
+ no fixed entry claims a nonexistent day (e.g. 30 February) and that both
+ movable entries resolve at all. Not "every date is a Fixed month/day"
+ (stale since fix round 1 -- 2 of 208 are Easter_offset). *)
let test_dates_resolve_in_a_leap_year () =
let l = load () in
List.iter