diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 12:52:13 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 12:52:13 +0200 |
| commit | 44472bbe31475a3c672ae003d928d7caffb4b50a (patch) | |
| tree | e74bae03c61b62479ef4f68b046e3345618933c8 /internal/render/render_test.go | |
| parent | 626f2275438a37e5cd2efb5964281b9bef5ce8cc (diff) | |
| parent | 7b220084cf3951c8cde0582efdfcf628afc64336 (diff) | |
| download | lectio-44472bbe31475a3c672ae003d928d7caffb4b50a.tar.gz lectio-44472bbe31475a3c672ae003d928d7caffb4b50a.zip | |
Merge branch 'of-offline-migration': offline daily view, remove scrapers
Diffstat (limited to 'internal/render/render_test.go')
| -rw-r--r-- | internal/render/render_test.go | 40 |
1 files changed, 4 insertions, 36 deletions
diff --git a/internal/render/render_test.go b/internal/render/render_test.go index e2a26fc..dd177bb 100644 --- a/internal/render/render_test.go +++ b/internal/render/render_test.go @@ -7,25 +7,10 @@ import ( "github.com/lukaszkasprzak/lectio/internal/liturgy" ) -func TestGatherBTDedup(t *testing.T) { - sec := liturgy.Section{ - Heading: "Psalm (Ps 1)", - Paragraphs: [][]string{{"stanza one"}, {"refrain"}, {"stanza two"}, {"refrain"}}, - } - _, blocks := GatherVersion("bt", sec, "new", "pl") - n := 0 - for _, b := range blocks { - if b == "refrain" { - n++ - } - } - if n != 1 { - t.Errorf("refrain appears %d times, want 1 (deduped)", n) - } -} - func TestGatherBible(t *testing.T) { - sec := liturgy.Section{Heading: "Ewangelia (J 20, 1. 11-18)"} + // Offline sections carry the English-canonical lookup reference in Ref; the + // display citation stays in the reader's sigla dialect. + sec := liturgy.Section{Heading: "Ewangelia", Citation: "J 20, 1. 11-18", Ref: "John 20:1,11-18"} label, blocks := GatherVersion("wuj", sec, "new", "pl") if !strings.Contains(label, "Wujek") { t.Errorf("label = %q", label) @@ -109,23 +94,6 @@ func TestGatherVersionNoReferenceLang(t *testing.T) { } } -// TestGatherVersionNoReferenceErrLang checks the "(no reference: ...)" block -// (a citation that bible.ToEnglishRef fails to convert, e.g. an unrecognised -// book) follows lang. -func TestGatherVersionNoReferenceErrLang(t *testing.T) { - sec := liturgy.Section{Citation: "Xyz 1, 1-2"} - - _, blocks := GatherVersion("wuj", sec, "new", "pl") - if len(blocks) == 0 || !strings.HasPrefix(blocks[0], "(brak odwołania: ") { - t.Errorf(`GatherVersion(..., "pl") blocks = %v, want prefix "(brak odwołania: "`, blocks) - } - - _, blocks = GatherVersion("wuj", sec, "new", "en") - if len(blocks) == 0 || !strings.HasPrefix(blocks[0], "(no reference: ") { - t.Errorf(`GatherVersion(..., "en") blocks = %v, want prefix "(no reference: "`, blocks) - } -} - func TestOfflineVersions(t *testing.T) { got := OfflineVersions([]string{"bt", "wuj", "vul"}) for _, v := range got { @@ -136,7 +104,7 @@ func TestOfflineVersions(t *testing.T) { } func TestGatherVersesBible(t *testing.T) { - sec := liturgy.Section{Heading: "Ewangelia (J 20, 1. 11-18)"} + sec := liturgy.Section{Heading: "Ewangelia", Citation: "J 20, 1. 11-18", Ref: "John 20:1,11-18"} label, verses, versified := GatherVerses("wuj", sec, "new", "pl") if !strings.Contains(label, "Wujek") { t.Errorf("label = %q", label) |
