aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-25 19:15:04 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-25 19:15:04 +0200
commitc6faa32c85e350349181ab920b0b8b7defdd678c (patch)
treedd45d3243c8c48c93b54516193433327c2065658 /test
parenta2be1f88ff9d2e4dd99689213692f2a03bbf999d (diff)
downloadcolitur-c6faa32c85e350349181ab920b0b8b7defdd678c.tar.gz
colitur-c6faa32c85e350349181ab920b0b8b7defdd678c.zip
feat(of): transcribe Tabula part II into precedence_of
Entries 5-9. Entries 5 and 7 differ only by subject -- 'Festa Domini' against 'Festa beatae Mariae Virginis et Sanctorum' -- so they key on Celebration.t.subject, the same field RG 91 entry 14 uses on the EF side, never on the slug. Entry 9's three clauses (late-Advent ferias from 17 December, the Nativity octave, Lenten ferias) are what separates a privileged feria from the ordinary one at entry 13. CORRECTION to the task brief, applied here rather than after: entries 3, 5 and 7 test 'not (is_proper layer)', not 'is_universal layer'. Every temporal-origin candidate Temporal_of.temporal constructs carries layer = "temporal" unconditionally, never universal_layer, so a positive universal-layer test silently excluded every temporal-cycle solemnity and Lord-subject feast from these entries -- Corpus Christi came out unclassified outright, and Trinity/Christ the King/Holy Family/the Baptism of the Lord landed one entry too low. is_universal is now dead and removed; entry 3's branch (written in Task 1) is amended along with the new entries 5 and 7. Only entries 4 and 8 still test is_proper directly, matching the Tabula's own proper-calendar rows. Also fixes a pre-existing typo in the brief's own 'entry 6: a Sunday per annum' test row: rank was Sollemnitas, which -- being tested at entry 3, earlier in the chain -- made the row fail regardless of the is_universal/is_proper question, since no real Sunday per annum is ever Sollemnitas. Changed to Festum, matching the adjacent 'Sunday of Christmas time' row and real Temporal_of output.
Diffstat (limited to 'test')
-rw-r--r--test/test_precedence_of.ml88
1 files changed, 87 insertions, 1 deletions
diff --git a/test/test_precedence_of.ml b/test/test_precedence_of.ml
index bf514ff..a06fb25 100644
--- a/test/test_precedence_of.ml
+++ b/test/test_precedence_of.ml
@@ -68,5 +68,91 @@ let test_part1 () =
Alcotest.(check int) label expected (Rite_of.Precedence_of.band c cand))
part1_cases
+let part2_cases =
+ [ ( "entry 5: a universal feast of the Lord",
+ ctx ~iso:"2026-08-06" ~season:Vocab_of.Ordinary_time,
+ mk ~subject:Subject.Lord ~slug:"of-transfiguration" ~rank:Vocab_of.Festum
+ ~origin:Precedence.Sanctoral (),
+ 50 );
+ ( "entry 6: a Sunday per annum",
+ ctx ~iso:"2026-07-12" ~season:Vocab_of.Ordinary_time,
+ (* rank is Festum, not the brief's original Sollemnitas: a real Sunday
+ per annum is never Sollemnitas (temporal_of.ml only grades Advent,
+ Lent and Easter Sundays that way, and those are entry 2, tested
+ before this one), and a Sollemnitas candidate here would hit entry 3
+ first regardless of layer -- the brief's own adjacent "Sunday of
+ Christmas time" row already uses Festum for the identical reason. *)
+ mk ~slug:"of-ordinary-time-sunday-15" ~rank:Vocab_of.Festum
+ ~origin:Precedence.Temporal (),
+ 60 );
+ ( "entry 6: a Sunday of Christmas time",
+ ctx ~iso:"2027-01-03" ~season:Vocab_of.Christmas,
+ mk ~slug:"of-christmas-sunday-2" ~rank:Vocab_of.Festum
+ ~origin:Precedence.Temporal (),
+ 60 );
+ ( "entry 7: a universal feast of a saint",
+ ctx ~iso:"2026-04-25" ~season:Vocab_of.Easter,
+ mk ~subject:Subject.Saint ~slug:"of-mark" ~rank:Vocab_of.Festum
+ ~origin:Precedence.Sanctoral (),
+ 70 );
+ ( "entry 7: a universal feast of the BVM",
+ ctx ~iso:"2026-05-31" ~season:Vocab_of.Ordinary_time,
+ mk ~subject:Subject.Bvm ~slug:"of-visitation" ~rank:Vocab_of.Festum
+ ~origin:Precedence.Sanctoral (),
+ 70 );
+ ( "entry 8: a proper feast",
+ ctx ~iso:"2026-04-25" ~season:Vocab_of.Easter,
+ mk ~layer:"proper:diocese-of-poznan" ~slug:"of-cathedral-dedication"
+ ~rank:Vocab_of.Festum ~origin:Precedence.Sanctoral (),
+ 80 );
+ ( "entry 9: an Advent feria on 17 December",
+ ctx ~iso:"2026-12-17" ~season:Vocab_of.Advent,
+ mk ~slug:"of-advent-3-thursday" ~rank:Vocab_of.Feria
+ ~origin:Precedence.Temporal (),
+ 90 );
+ ( "entry 9: a day within the Octave of the Nativity",
+ ctx ~iso:"2026-12-29" ~season:Vocab_of.Christmas,
+ mk ~slug:"of-christmas-0-tuesday" ~rank:Vocab_of.Feria
+ ~origin:Precedence.Temporal (),
+ 90 );
+ ( "entry 9: a Lenten feria",
+ ctx ~iso:"2026-03-03" ~season:Vocab_of.Lent,
+ mk ~slug:"of-lent-2-tuesday" ~rank:Vocab_of.Feria
+ ~origin:Precedence.Temporal (),
+ 90 );
+ (* MY RULING (2026-08-25, task-2-brief correction): every temporal-origin
+ celebration Temporal_of.temporal constructs carries [layer = "temporal"],
+ never [Precedence_of.universal_layer] -- so entries 3, 5 and 7 must test
+ [not (is_proper layer)], not [is_universal layer]. These four rows pin
+ exactly what that correction fixes: without it, Corpus Christi comes out
+ unclassified (a hole) and Trinity/Christ the King land at entry 6 instead
+ of entry 3. *)
+ ( "entry 3: Trinity Sunday is a solemnity of the general calendar",
+ ctx ~iso:"2026-05-31" ~season:Vocab_of.Ordinary_time,
+ mk ~slug:"of-trinity" ~rank:Vocab_of.Sollemnitas ~origin:Precedence.Temporal (),
+ 30 );
+ ( "entry 3: Corpus Christi, a Thursday, is not unclassified",
+ ctx ~iso:"2026-06-04" ~season:Vocab_of.Ordinary_time,
+ mk ~slug:"of-corpus-christi" ~rank:Vocab_of.Sollemnitas ~origin:Precedence.Temporal (),
+ 30 );
+ ( "entry 5: the Baptism of the Lord is a feast OF THE LORD",
+ ctx ~iso:"2026-01-11" ~season:Vocab_of.Christmas,
+ mk ~subject:Subject.Lord ~slug:"of-baptism-of-the-lord" ~rank:Vocab_of.Festum
+ ~origin:Precedence.Temporal (),
+ 50 );
+ ( "entry 6, not 5: an ordinary Christmas Sunday has no Lord subject",
+ ctx ~iso:"2027-01-03" ~season:Vocab_of.Christmas,
+ mk ~subject:Subject.Temporal ~slug:"of-christmas-sunday-2" ~rank:Vocab_of.Festum
+ ~origin:Precedence.Temporal (),
+ 60 ) ]
+
+let test_part2 () =
+ List.iter
+ (fun (label, c, cand, expected) ->
+ Alcotest.(check int) label expected (Rite_of.Precedence_of.band c cand))
+ part2_cases
+
let suite =
- ("precedence-of", [ Alcotest.test_case "Tabula part I (entries 1-4)" `Quick test_part1 ])
+ ( "precedence-of",
+ [ Alcotest.test_case "Tabula part I (entries 1-4)" `Quick test_part1;
+ Alcotest.test_case "Tabula part II (entries 5-9)" `Quick test_part2 ] )