summaryrefslogtreecommitdiff
path: root/internal/bible/crosschapter_test.go
Commit message (Collapse)AuthorAgeFilesLines
* test(bible): skip corpus-dependent tests when optional corpora aren't embeddedLukasz Kasprzak2026-07-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Since 51c0f4e split the corpora (only vul embedded by default; wuj/drb/grb behind -tags fullbible), `go test ./...` on the default build was red across six packages -- every failure was a test assuming an optional corpus is present. Guard those assertions with a skip keyed on bible.Meta(code), so they run under -tags fullbible and skip -- not fail -- on the default vul-only build. Mixed tests are split into subtests so the always-embedded vul assertions and pure logic (pl->vul fallback, explicit passthrough, bt-rejection, i18n labels) keep running on both builds. Test-only change; no product code or corpora touched. - internal/bible: TestVerses, TestLookup, TestCorpusBooks, TestChapters, TestGrbNoApparatusMarkers, TestCrossChapterRange* (requireCorpus helper). - internal/cli, config, render, tui, web: the same pattern for their corpus-dependent tests. - Fixes an index-out-of-range panic in internal/tui's reader tests that was aborting the package binary and masking 3 further corpus-absence failures (TestReaderBookmarkFlow, TestReaderChapterJump, TestReaderRemembersPlace). Verified: `go test ./...` and `go test -tags fullbible ./...` both green (0 FAIL); guards active only on the default build (29 skips vs 1 unrelated pre-existing); gofmt and go vet clean.
* feat(bible): resolve and display cross-chapter verse ranges (N:M-P:Q)Lukasz Kasprzak2026-07-271-0/+158
Lookup now detects a verse-tail range that crosses a chapter boundary ("M-P:Q", e.g. "30-28:7" in "Sirach 27:30-28:7") and fetches chapter N from verse M to its end, any whole chapters between, and chapter P from verse 1 through Q, instead of misreading the tail as a plain from-to range and coming up empty. SplitRef expands the same pattern inside a comma list so a trailing group after the jump (e.g. the ",8-10" in "Malachi 1:14-2:2,8-10") resolves against the new current chapter. FormatRef renders the range intact as "<sigla> N:M-P:Q" instead of splitting off a fake new-chapter marker from the embedded "P:" and mangling the display (previously "Sir 27:7"). No sentinel value is ever stored in a ref string; it only bounds an internal verse-filter loop in Lookup.