summaryrefslogtreecommitdiff
path: root/test/test_sanctoral_ef.ml
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-12 18:26:21 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-12 18:26:21 +0200
commitdbde8523f2ec2f0db4d2619afed8575ccf8a3641 (patch)
tree89a583bd22310b1f93c3cdfd6ac7fa9772b68147 /test/test_sanctoral_ef.ml
parent1f915cb61bf68dc0165a750a9cae92c3241a72f9 (diff)
downloadcolitur-dbde8523f2ec2f0db4d2619afed8575ccf8a3641.tar.gz
colitur-dbde8523f2ec2f0db4d2619afed8575ccf8a3641.zip
test(sanctoral_ef): fix round 1 (F8) -- guard against wholesale name.pl loss
The previous commit's bootstrap_sanctoral.ml change (name.pl optional) is correct and verified not to silently drop a present name, but nothing in the suite would have caught a regeneration that dropped name.pl WHOLESALE -- the exact defect lectio itself shipped once (a regeneration that lost all 322 Polish names, only caught because that project's own review ran cmd/lectio-ef-dump, which happens to include name fields; this project's own test_load_and_counts checks entry/status/rank counts only, none of which move if every name.pl vanishes). Added a 322-of-327 count assertion (5 legitimately lack it, matching parse_names's own list), independently re-derived: `grep -c '^name.pl' tridentine-calendar.ini` = 322, cross-checked against `grep -c '(pl' data/ef/sanctoral.sexp` = 322 exactly.
Diffstat (limited to 'test/test_sanctoral_ef.ml')
-rw-r--r--test/test_sanctoral_ef.ml21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_sanctoral_ef.ml b/test/test_sanctoral_ef.ml
index 24ed972..e3b34a6 100644
--- a/test/test_sanctoral_ef.ml
+++ b/test/test_sanctoral_ef.ml
@@ -51,6 +51,27 @@ let test_load_and_counts () =
Alcotest.(check int) "12 Class1" 12 (List.length class1);
let temporal_subjects = List.filter (fun e -> e.L.cel.Cel.subject = Sub.Temporal) l.L.entries in
Alcotest.(check int) "no Subject.Temporal" 0 (List.length temporal_subjects);
+ (* ef-rebootstrap fix round 1 (F8): a guard against WHOLESALE Polish-name
+ loss, the exact defect lectio itself shipped once (a regeneration that
+ dropped all 322 name.pl entries, the "SECOND Critical" the lectio side
+ of this session's own work found and fixed -- register/ledger record).
+ `parse_names`'s own `field_opt` change (this task's first commit) can
+ legitimately drop to en-only for a genuinely pl-less source entry --
+ verified NOT to silently drop a PRESENT name -- but nothing before
+ this assertion would have caught a regeneration that dropped pl
+ WHOLESALE the way lectio's once did: `test_load_and_counts` checked
+ entry/status/rank counts only, none of which move if every name.pl
+ vanishes. Independently re-derived, not transcribed: `grep -c
+ '^name.pl' tridentine-calendar.ini` = 322 (327 entries, 5 lack it --
+ the same 5 `parse_names` documents), cross-checked against
+ `grep -c '(pl' data/ef/sanctoral.sexp` = 322 exactly. *)
+ let with_pl =
+ List.filter
+ (fun e -> Names.find e.L.cel.Cel.names (Lang.of_string_exn "pl") <> None)
+ l.L.entries
+ in
+ Alcotest.(check int) "322 of 327 entries carry a Polish name (5 legitimately do not)" 322
+ (List.length with_pl);
(* Every slug already had to pass Slug.of_string during load (Slug.t_of_sexp
is the validating parser -- an invalid slug would have failed the whole
Layer.load with Error, never landing here silently). Re-checking is