summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-14 17:05:51 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-14 17:05:51 +0200
commit6f5814ccdbc839b75c3e6de95a8ba9a755bc6ece (patch)
treefdb96f0b5da902e03d6aa1ae5e14d46755d9ea96 /test
parent2c0187f42cc45864932aba2529f876be86ddba39 (diff)
downloadcolitur-6f5814ccdbc839b75c3e6de95a8ba9a755bc6ece.tar.gz
colitur-6f5814ccdbc839b75c3e6de95a8ba9a755bc6ece.zip
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.
Diffstat (limited to 'test')
-rw-r--r--test/dune1
-rw-r--r--test/test_lectionary.ml16
2 files changed, 16 insertions, 1 deletions
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) ]