aboutsummaryrefslogtreecommitdiff
path: root/internal/calendar/precedence_ef_repro_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/calendar/precedence_ef_repro_test.go')
-rw-r--r--internal/calendar/precedence_ef_repro_test.go39
1 files changed, 39 insertions, 0 deletions
diff --git a/internal/calendar/precedence_ef_repro_test.go b/internal/calendar/precedence_ef_repro_test.go
index 77919d9..09cadbd 100644
--- a/internal/calendar/precedence_ef_repro_test.go
+++ b/internal/calendar/precedence_ef_repro_test.go
@@ -81,3 +81,42 @@ func TestMatthewBeatsSeptemberEmberWednesday(t *testing.T) {
}
}
}
+
+// TestImmaculateConceptionBeatsAdventSunday: found, not named among the
+// seven, while verifying defect 4 (Sunday ranks) against the real sanctoral
+// data. RG 91 entry 4 (Immaculate Conception, Assumption BVM) sits ABOVE
+// entry 6 (Sundays of Advent/Lent/Passiontide) -- unlike an ORDINARY
+// I-class feast (entry 11, e.g. St Joseph), the Immaculate Conception
+// (8 December) is not impeded by the Advent Sunday it falls on at all. Before
+// defect 4's own fix, Advent Sundays were wrongly II class, so this was
+// accidentally right (I class beats II class outright); once Sundays became
+// I class the tie mattered for the first time.
+func TestImmaculateConceptionBeatsAdventSunday(t *testing.T) {
+ for _, year := range []string{"2013", "2019", "2024"} {
+ day := efCompute(year + "-12-08")
+ if day.Observed.Slug != "immaculate-conception-of-the-blessed-virgin-mary" {
+ t.Errorf("%s-12-08 observed = %q want immaculate-conception-of-the-blessed-virgin-mary (RG 91 entry 4 beats entry 6)", year, day.Observed.Slug)
+ }
+ }
+}
+
+// TestVigilOfChristmasSurvivesAdventSunday: found, not named among the
+// seven, while verifying defect 4 against the real sanctoral data -- and
+// worse than a wrong winner. RG 91 entry 5 (Vigil & Octave day of the
+// Nativity) also sits above entry 6, so the Vigil of Christmas (24 December)
+// is not impeded by falling on Advent IV either. Without this, defect 4
+// alone would have made the Advent Sunday win a genuine tie, sending the
+// Vigil into transferIfImpededEF's forward walk -- which has no way to
+// re-place a transfer that crosses the Dec31/Jan1 boundary (celebrationDate
+// re-resolves a fixed date using the year of whatever day is being queried,
+// so a walk landing in the following January can never match the query that
+// produced it). The Vigil did not move to the wrong day; it vanished for the
+// whole year.
+func TestVigilOfChristmasSurvivesAdventSunday(t *testing.T) {
+ for _, year := range []string{"2006", "2017", "2023", "2028"} {
+ day := efCompute(year + "-12-24")
+ if day.Observed.Slug != "vigil-of-christmas" {
+ t.Errorf("%s-12-24 observed = %q want vigil-of-christmas (RG 91 entry 5 beats entry 6; must not vanish)", year, day.Observed.Slug)
+ }
+ }
+}