diff options
Diffstat (limited to 'test/cli.t')
| -rw-r--r-- | test/cli.t | 159 |
1 files changed, 153 insertions, 6 deletions
@@ -17,7 +17,7 @@ A year outside the supported domain is rejected (exit 2): No/garbage arguments give a usage error (exit 2): $ colitur - colitur: usage: colitur easter <year> | colitur temporal <year> | colitur day <year> | colitur readings <year> | colitur emit --format FMT --from Y --to Y | colitur table --year Y --template FILE | colitur render --template FILE --year Y | colitur publish --from Y --to Y --out DIR | colitur lang --list|--dump CODE|--check FILE | colitur config --show | colitur check FILE | colitur new-overlay (try: colitur --help) + colitur: usage: colitur easter <year> | colitur temporal <year> | colitur day <year> | colitur readings <year> | colitur rubrics <year> | colitur emit --format FMT --from Y --to Y | colitur table --year Y --template FILE | colitur render --template FILE --year Y | colitur publish --from Y --to Y --out DIR | colitur lang --list|--dump CODE|--check FILE | colitur config --show | colitur check FILE | colitur new-overlay (try: colitur --help) [2] The EF temporal cycle for a year, one line per day: @@ -199,6 +199,91 @@ A year outside the supported domain is rejected (exit 2): colitur: year 1000 out of range 1583..9999 [2] +Rubrics (Task 4, celebrant-rubrics-phase1): the day's own Mass formulary, one +row per day: date, the formulary's slug (which Mass is actually said, not +always the day's own), and how that was decided +(proper/own/preceding-sunday/common/votive). TAB-separated -- not space like +`day`, not " | " like `readings` -- because a resolved formulary NAME (a +later column, not this one) can itself contain both spaces and punctuation a +citation never does, and TAB is what stays unambiguous either way. A +separate command for the same mechanical reason `readings` is: `day`'s row +is fixed-width space-separated with a variable-length "+slug" tail. + + $ colitur rubrics 2026 | head -3 + 2026-01-01 ef-circumcision own true true nativity + 2026-01-02 ef-christmas-1-friday own false true nativity + 2026-01-03 ef-christmas-1-saturday votive false true bvm + + $ colitur rubrics 2026 | wc -l + 365 + +1 January reads "own", not "proper": the Circumcision is a TEMPORAL-origin +office (Rite_ef.Temporal_ef, not the sanctoral Layer), so step 1 of the +resolution chain (a SANCTORAL observed celebration's own proper) does not +apply to it -- step 2 does (the day's own temporal slug in the lectionary), +tagged `own`. Contrast a real sanctoral saint with his own proper: + + $ colitur rubrics 2038 | grep '^2038-03-08' + 2038-03-08 john-of-god proper false true common + +A saint with no proper of his own says his assigned Common (step 4): + + $ colitur rubrics 2038 | grep '^2038-03-06' + 2038-03-06 common-of-non-virgins-1 common false true common + +A weekday with no proper of its own resumes the preceding Sunday's, never +its own observed slug -- 1 December 2025 is the Monday after Advent I, and +Advent's ferias have no Mass of their own (step 3): + + $ colitur rubrics 2025 | grep '^2025-12-01' + 2025-12-01 ef-advent-sunday-1 preceding-sunday false false common + +3 January 2026 above ("votive") is the RG 78/309(a) Saturday Mass of Our +Lady, said IN PLACE of the day's own office's Mass while the office (an +unoccupied IV-class Saturday) itself is kept unchanged -- distinct from +`own` precisely because a votive Mass is not the day's own, even though +`said` names the identical slug either way. + +A year outside the supported domain is rejected (exit 2): + + $ colitur rubrics 1000 + colitur: year 1000 out of range 1583..9999 + [2] + +--overlay is accepted, the same reasoning `readings` gets it: an overlay can +change which celebration is observed, hence which Mass formulary is said. +Baseline, the unoccupied Saturday says Our Lady's votive Mass; with the +diocesan overlay's local patron observed instead (no proper or Common of his +own in the fixture), the chain falls all the way back to step 3: + + $ colitur rubrics 2026 --overlay fixtures/overlay-example-diocesan.sexp | grep '^2026-07-11' + 2026-07-11 ef-time-after-pentecost-sunday-6 preceding-sunday false true common + $ colitur rubrics 2026 | grep '^2026-07-11' + 2026-07-11 ef-time-after-pentecost-6-saturday votive false true bvm + +`--lang`/`--raw`/`--sigla-*` are refused rather than silently ignored, unlike +`readings`: this row resolves no display name and no citation for any of +them to affect. + + $ colitur rubrics 2026 --lang en + colitur: --lang/--raw have no effect on `rubrics`; refusing rather than ignoring them + [2] + + $ colitur rubrics 2026 --raw + colitur: --lang/--raw have no effect on `rubrics`; refusing rather than ignoring them + [2] + + $ colitur rubrics 2026 --sigla-style en + colitur: --sigla-style/--sigla-book/--sigla-tradition have no effect on `rubrics`; refusing rather than ignoring them + [2] + +`colitur day` and `colitur readings` are unaffected by any of the above: + + $ colitur day 2026 --raw | head -1 + 2026-01-01 thursday christmastide - ef-circumcision class-1 white + $ colitur readings 2026 --raw | head -1 + 2026-01-01 ef-circumcision | Titus 2:11-15 | Luke 2:21 + An explicit COLITUR_DATA_DIR that does not hold the data is an error (exit 2), never a silent fall-back to some other copy. A packager or operator who names a directory has stated an intent; quietly calendaring off a different one @@ -247,7 +332,24 @@ The error path is the mirror image -- nothing on stdout, exit 2: Every command the help lists is a command the binary actually accepts. This is the check that catches help text drifting away from the dispatch: - $ for c in easter temporal day readings; do colitur $c 2026 > /dev/null || echo "$c FAILED"; done + $ for c in easter temporal day readings rubrics; do colitur $c 2026 > /dev/null || echo "$c FAILED"; done + +`rubrics`' own field count drifted once already (Task 5 landed a fourth +column, creed; --help's "output formats" section and its worked example +still showed three, and stayed wrong for a whole review round because +nothing here pinned the help BODY, only command dispatch above). This +compares --help's own worked example against what `rubrics` actually +prints for the identical day, so the two cannot silently drift apart +again in either direction: + + $ colitur --help | grep '^ rubrics date' + rubrics date, formulary slug, source, creed, gloria, preface -- TAB-separated + + $ colitur --help | sed -n '/^ rubrics date/{n;p}' + 2026-01-01[TAB]ef-circumcision[TAB]own[TAB]true[TAB]true[TAB]nativity + + $ colitur rubrics 2026 | grep '^2026-01-01' | sed $'s/\t/[TAB]/g' + 2026-01-01[TAB]ef-circumcision[TAB]own[TAB]true[TAB]true[TAB]nativity --version prints the version alone, to standard output, exit 0. Deliberately not embedded in the help text above: this pin would then have to be edited @@ -327,14 +429,14 @@ A flag needing a value, given none: $ colitur day 2026 --overlay colitur: --overlay needs a file path - colitur: usage: colitur easter <year> | colitur temporal <year> | colitur day <year> | colitur readings <year> | colitur emit --format FMT --from Y --to Y | colitur table --year Y --template FILE | colitur render --template FILE --year Y | colitur publish --from Y --to Y --out DIR | colitur lang --list|--dump CODE|--check FILE | colitur config --show | colitur check FILE | colitur new-overlay (try: colitur --help) + colitur: usage: colitur easter <year> | colitur temporal <year> | colitur day <year> | colitur readings <year> | colitur rubrics <year> | colitur emit --format FMT --from Y --to Y | colitur table --year Y --template FILE | colitur render --template FILE --year Y | colitur publish --from Y --to Y --out DIR | colitur lang --list|--dump CODE|--check FILE | colitur config --show | colitur check FILE | colitur new-overlay (try: colitur --help) [2] An unknown option is rejected rather than treated as a positional word: $ colitur day 2026 --diocese colitur: unknown option --diocese - colitur: usage: colitur easter <year> | colitur temporal <year> | colitur day <year> | colitur readings <year> | colitur emit --format FMT --from Y --to Y | colitur table --year Y --template FILE | colitur render --template FILE --year Y | colitur publish --from Y --to Y --out DIR | colitur lang --list|--dump CODE|--check FILE | colitur config --show | colitur check FILE | colitur new-overlay (try: colitur --help) + colitur: usage: colitur easter <year> | colitur temporal <year> | colitur day <year> | colitur readings <year> | colitur rubrics <year> | colitur emit --format FMT --from Y --to Y | colitur table --year Y --template FILE | colitur render --template FILE --year Y | colitur publish --from Y --to Y --out DIR | colitur lang --list|--dump CODE|--check FILE | colitur config --show | colitur check FILE | colitur new-overlay (try: colitur --help) [2] The shipped example overlay is runnable documentation, and it must actually @@ -449,10 +551,55 @@ CSV run rather than one per year: $ colitur emit --format csv --from 2027 --to 2028 | wc -l 732 -sexp and xml are also available: +sexp and xml are also available. This line count moved twice in the same +whole-branch review fix round, for two different reasons, both cosmetic: +[emit --format sexp] pretty-prints with [Sexplib.Sexp.to_string_hum], a +column-width wrapping printer, not a fixed-shape one, so any change to a +value's own rendered WIDTH can shift where it wraps. + +9010 -> 9011 (RG 476(f)): 2027's All Souls' Day (2 November) record grew +a single wrapped line when its own [creed] field's value changed from +[true] to [false] (the Creed is never said at a Requiem Mass; see +rubrics_ef.ml), because "false" is one character longer than "true" and +pushed that one line's rendered width over the wrap threshold. + +9011 -> 9025 (Mass_formulary.t.said honesty, Fix 3): [said] gained an +[option] (its own .mli has the full account) -- every day's formulary +record now prints [(said (<slug>))] instead of [(said <slug>)], one +character wider, and a [Votive] day (the RG 78 Saturday Mass of Our +Lady) prints [(said ())] instead of naming a slug at all, since the +data genuinely names none for the Mass actually said. Both changes ripple +across many lines' own wrap points, not just the days whose DATA changed +-- confirmed directly (diffed the full sexp output line by line): every +difference is exactly this [said] shape change or a consequent wrap +shift, nothing else. Not a claim that [emit]'s FORMAT changed, only that +individual records' pretty-printed SHAPE did. + +9025 -> 9197 (Gloria, celebrant-rubrics-phase1 Phase 2): {!Liturgical_day.t} +gained a [gloria] field, the same seam [creed] already used -- [emit +--format sexp] dumps the whole record ({!Sexplib.Sexp.to_string_hum} over +[Liturgical_day.sexp_of_t]) unlike [csv]/[json]/[xml] (a curated +[View]/[Record] projection that has never included [creed] either, hence +their own line counts above are UNCHANGED by this task -- confirmed by +this cram file's own diff touching only the [sexp] count). All 365 of +2027's records print a new [(gloria <bool>)] token (checked directly, +[grep -c gloria]), but the wrap-point mechanics are the same cosmetic +reflow the two entries above describe, not a fixed one-line-per-record +addition: 2027-01-01's own record wraps [gloria] onto its own new line, +while 2027-01-02's fits it on the same line as [creed] and [formulary] -- +172 of 365 records happened to cross a wrap boundary, the rest did not. + +9197 -> 9252 (preface, celebrant-rubrics-phase1 Phase 3): {!Liturgical_day.t} +gained a [preface] field, the same seam [gloria] just above used -- all +365 of 2027's records print a new [(preface (<variant>))] token (checked +directly, [grep -c "(preface"]), [(preface ())] on exactly one day +(2027's own Good Friday, 26 March -- this engine resolves no Mass at all +that day, {!Rite_ef.Rubrics_ef.preface}'s own citation). Same cosmetic +reflow mechanics as every entry above, not a fixed one-line-per-record +addition. $ colitur emit --format sexp --from 2027 --to 2027 | wc -l - 8472 + 9252 $ colitur emit --format xml --from 2027 --to 2027 | head -2 <?xml version="1.0" encoding="UTF-8"?> |
