summaryrefslogtreecommitdiff
path: root/internal/caldata/caldata_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/caldata/caldata_test.go')
-rw-r--r--internal/caldata/caldata_test.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/caldata/caldata_test.go b/internal/caldata/caldata_test.go
index 5ffa57e..0d6616e 100644
--- a/internal/caldata/caldata_test.go
+++ b/internal/caldata/caldata_test.go
@@ -1,6 +1,7 @@
package caldata
import (
+ "strings"
"testing"
"github.com/lukaszkasprzak/lectio/internal/calendar"
@@ -30,6 +31,31 @@ 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"},
+ "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"},
+ }
+ for slug, w := range want {
+ rc, ok := l.Cels[slug]
+ if !ok {
+ 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])
+ }
+ }
+}
+
func TestTridentineLoads(t *testing.T) {
l := Tridentine()
if l.ID != "tridentine" {