diff options
Diffstat (limited to 'internal/caldata/caldata_test.go')
| -rw-r--r-- | internal/caldata/caldata_test.go | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/internal/caldata/caldata_test.go b/internal/caldata/caldata_test.go index 0d6616e..12aa765 100644 --- a/internal/caldata/caldata_test.go +++ b/internal/caldata/caldata_test.go @@ -33,13 +33,16 @@ func TestUniversalLoads(t *testing.T) { func TestUniversalSanctoralReadings(t *testing.T) { l := Universal() - // A feast/solemnity or a PROPER-reading memorial carries its own inline Mass - // (imported from catholic-resources.org) rather than falling back to the ferial. - want := map[string][2]string{ // slug -> {reading.first substr, reading.gospel substr} - "barnabas-the-apostle": {"Acts 11", "Matthew 10:7-13"}, + // A feast/solemnity or a PROPER-reading memorial carries its own inline Mass. + // Partial-proper memorials keep ONLY the strictly-proper part (the resolver + // fills the rest from the ferial): the Guardian Angels a proper gospel, St + // Barnabas a proper first reading, Our Lady of Sorrows a proper gospel. + want := map[string][2]string{ // slug -> {reading.first substr, reading.gospel substr; "" = absent} "assumption-of-the-blessed-virgin-mary": {"Revelation 11", "Luke 1:39-56"}, - "our-lady-of-sorrows": {"Hebrews 5", "John 19:25-27"}, "all-saints": {"Revelation 7", "Matthew 5:1-12"}, + "barnabas-the-apostle": {"Acts 11", ""}, + "guardian-angels": {"", "Matthew 18:1-5"}, + "our-lady-of-sorrows": {"", "John 19:25-27"}, } for slug, w := range want { rc, ok := l.Cels[slug] @@ -47,11 +50,15 @@ func TestUniversalSanctoralReadings(t *testing.T) { t.Errorf("missing %q", slug) continue } - if got := rc.Fields["reading.first"]; !strings.Contains(got, w[0]) { - t.Errorf("%s: reading.first = %q, want containing %q", slug, got, w[0]) - } - if got := rc.Fields["reading.gospel"]; !strings.Contains(got, w[1]) { - t.Errorf("%s: reading.gospel = %q, want containing %q", slug, got, w[1]) + for i, part := range []string{"reading.first", "reading.gospel"} { + got := rc.Fields[part] + if w[i] == "" { + if got != "" { + t.Errorf("%s: %s = %q, want absent (ferial)", slug, part, got) + } + } else if !strings.Contains(got, w[i]) { + t.Errorf("%s: %s = %q, want containing %q", slug, part, got, w[i]) + } } } } |
