From 6f5814ccdbc839b75c3e6de95a8ba9a755bc6ece Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Fri, 14 Aug 2026 17:05:51 +0200 Subject: data(ef): bootstrap the temporal lectionary from lectio 119 entries, Epistle + Gospel only. The generator refuses a section carrying exactly one of the two: an Epistle without a Gospel is malformed and wants investigating, not shipping. SHA-256 of the source INI is in the provenance header, as with sanctoral.sexp. --- test/dune | 1 + test/test_lectionary.ml | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/dune b/test/dune index 714ffb2..fe5e4cc 100644 --- a/test/dune +++ b/test/dune @@ -6,6 +6,7 @@ ../data/ef/adjustments.sexp ../data/ef/expected-divergences.sexp ../data/ef/expected-divergences-missalemeum.sexp + ../data/ef/lectionary.sexp fixtures/lectio-ef-2005-2050.txt fixtures/missalemeum-ef-2026-2027.txt) (preprocess diff --git a/test/test_lectionary.ml b/test/test_lectionary.ml index fba890a..c6a1cac 100644 --- a/test/test_lectionary.ml +++ b/test/test_lectionary.ml @@ -77,9 +77,23 @@ let test_load_never_raises () = | Error _ -> () | Ok _ -> Alcotest.fail "missing file: expected Error, got Ok" +let test_ef_data_file_loads () = + match Lectionary.load "../data/ef/lectionary.sexp" with + | Error e -> Alcotest.fail e + | Ok l -> + Alcotest.(check int) "entry count" 119 + (List.length (Lectionary.entries l)); + (match Lectionary.find l (slug "ef-lent-1-monday") with + | Some [ a; b ] -> + Alcotest.(check string) "epistle" "Ezech 34:11-16" a.Citation.reference; + Alcotest.(check string) "gospel" "Matt 25:31-46" b.Citation.reference + | Some _ -> Alcotest.fail "expected exactly two citations" + | None -> Alcotest.fail "ef-lent-1-monday missing") + let suite = [ ("find present", `Quick, test_find_present); ("find absent", `Quick, test_find_absent); ("duplicate slug rejected", `Quick, test_duplicate_slug_rejected); ("sexp round-trip", `Quick, test_sexp_round_trip); - ("load never raises", `Quick, test_load_never_raises) ] + ("load never raises", `Quick, test_load_never_raises); + ("ef data file loads", `Quick, test_ef_data_file_loads) ] -- cgit v1.3