diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-24 16:29:23 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-24 16:29:23 +0200 |
| commit | 8a5da8756cf6b57aa36c01b71ce893f7967d3a29 (patch) | |
| tree | 10873a692400fa25ce54c67ac9fc34d46af86272 /test/test_mass_formulary.ml | |
| parent | 4f87cbde4ee79ac96aa7ebfed105b3a5ec02be43 (diff) | |
| parent | 73b15551804bb63ee0081005e2869d36afb54be2 (diff) | |
| download | colitur-8a5da8756cf6b57aa36c01b71ce893f7967d3a29.tar.gz colitur-8a5da8756cf6b57aa36c01b71ce893f7967d3a29.zip | |
merge: celebrant Mass rubrics, and four rubrical corrections
colitur now prints what a real ordo prints for the Mass: which formulary is
said and how it was reached, the Gloria, the Creed, the preface, and the
commemorations with their Low-Mass/sung distinction. colitur rubrics joins
day and readings.
Four defects were found and fixed on the way, each by an external witness
rather than by inspection: the Creed said at Requiem Masses (RG 476(f)),
the missing bissextile shift of St Matthias and St Gabriel (2 041 leap
years), Rogation Monday and Tuesday coloured violet in Paschaltide (RG
119(b)), and the ferias after the Ascension resuming the wrong Sunday's
Mass rather than the Ascension's.
Validation gained a sixth layer and then some: the preface is checked
against three independent publishers over seven witness-years (FIUV, three
LMS editions, three extraordinaryform.org editions), none of which shares
the Divinum Officium -> missalemeum -> lectio lineage the older layers all
descend from.
Diffstat (limited to 'test/test_mass_formulary.ml')
| -rw-r--r-- | test/test_mass_formulary.ml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/test_mass_formulary.ml b/test/test_mass_formulary.ml new file mode 100644 index 0000000..1316e47 --- /dev/null +++ b/test/test_mass_formulary.ml @@ -0,0 +1,41 @@ +module MF = Colitur_kernel.Mass_formulary +module Slug = Colitur_kernel.Slug + +let slug s = Slug.of_string_exn s + +let test_round_trips_through_sexp () = + let f = { MF.said = Some (slug "ef-time-after-pentecost-sunday-9"); via = MF.Preceding_sunday } in + let f' = MF.t_of_sexp (MF.sexp_of_t f) in + Alcotest.(check (option string)) "slug survives" + (Option.map Slug.to_string f.MF.said) (Option.map Slug.to_string f'.MF.said); + Alcotest.(check bool) "source survives" true (f.MF.via = f'.MF.via) + +(* [said] is [None] exactly for {!MF.Votive} -- see the .mli's own citation. + Round-tripped separately so the [None] case has its own witness, not only + inferred from the [Some] case above. *) +let test_none_said_round_trips_through_sexp () = + let f = { MF.said = None; via = MF.Votive } in + let f' = MF.t_of_sexp (MF.sexp_of_t f) in + Alcotest.(check bool) "said stays None" true (f'.MF.said = None); + Alcotest.(check bool) "source survives" true (f.MF.via = f'.MF.via) + +(* [to_string] is what an ordo line shows. It names the SOURCE, not the slug, + because the slug is a key and the reader wants "of the preceding Sunday". *) +let test_to_string_names_the_source () = + let cases = + [ (MF.Proper, "proper"); (MF.Own_slug, "own"); (MF.Preceding_sunday, "preceding-sunday"); + (MF.Common, "common"); (MF.Votive, "votive") ] + in + List.iter + (fun (via, expected) -> + Alcotest.(check string) expected expected + (MF.source_to_string via)) + cases + +let suite = + ( "Mass_formulary", + [ Alcotest.test_case "sexp round-trips" `Quick test_round_trips_through_sexp; + Alcotest.test_case "sexp round-trips, said = None (Votive)" `Quick + test_none_said_round_trips_through_sexp; + Alcotest.test_case "source_to_string names each source" `Quick + test_to_string_names_the_source ] ) |
