diff options
Diffstat (limited to 'internal/readings/readings_test.go')
| -rw-r--r-- | internal/readings/readings_test.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/readings/readings_test.go b/internal/readings/readings_test.go index fd355ff..20df5e0 100644 --- a/internal/readings/readings_test.go +++ b/internal/readings/readings_test.go @@ -55,6 +55,29 @@ func TestFilterPartsAll(t *testing.T) { } } +func TestFilterPartsTraditionalAllReadingsOnly(t *testing.T) { + secs := []liturgy.Section{ + {PartID: "introitus", Heading: "Introit"}, + {PartID: "oratio", Heading: "Kolekta"}, + {PartID: "lectio", Heading: "Lekcja"}, + {PartID: "graduale", Heading: "GraduaĆ"}, + {PartID: "evangelium", Heading: "Ewangelia"}, + {PartID: "offertorium", Heading: "Ofiarowanie"}, + {PartID: "secreta", Heading: "Sekreta"}, + {PartID: "communio", Heading: "Komunia"}, + {PartID: "postcommunio", Heading: "Pokomunia"}, + } + cfg := config.Config{Lectionary: "traditional"} + got := filterParts(secs, cfg, true) + + if len(got) != 2 { + t.Fatalf("got %d sections, want 2: %+v", len(got), got) + } + if got[0].PartID != "lectio" || got[1].PartID != "evangelium" { + t.Errorf("got %+v, want [lectio evangelium] in order", got) + } +} + func TestLoadModernRoutes(t *testing.T) { html, err := os.ReadFile("../liturgy/testdata/2026-07-22.html") if err != nil { |
