package export import ( "bytes" "strings" "testing" "github.com/lukaszkasprzak/lectio/internal/liturgy" ) func sampleSecs() []liturgy.Section { return []liturgy.Section{{ Heading: "Ewangelia (Mt 13, 1-9)", Citation: "Mt 13, 1-9", PartID: "ewangelia", Paragraphs: [][]string{{"Owego dnia Jezus wyszedł z domu i usiadł nad jeziorem."}}, }} } func TestMarkdownAndText(t *testing.T) { info := liturgy.DayInfo{Name: "Środa XV tygodnia", Colour: "green"} md := Markdown("2026-07-22", info, sampleSecs(), "bt", "new", "en") if !strings.Contains(md, "# Środa") || !strings.Contains(md, "## Gospel") || !strings.Contains(md, "Jezus wyszedł") { t.Errorf("markdown:\n%s", md) } txt := Text("2026-07-22", info, sampleSecs(), "bt", "new", "en") if !strings.Contains(txt, "Jezus wyszedł") || !strings.Contains(txt, "Gospel") { t.Errorf("text:\n%s", txt) } } func TestReadingsPDF(t *testing.T) { info := liturgy.DayInfo{Name: "Środa XV tygodnia"} pdf, err := ReadingsPDF("2026-07-22", info, sampleSecs(), "bt", "new", "en") if err != nil { t.Fatal(err) } if len(pdf) < 1000 || !bytes.HasPrefix(pdf, []byte("%PDF")) { t.Errorf("bad pdf len=%d", len(pdf)) } }