diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-29 11:46:17 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-29 11:46:17 +0200 |
| commit | 8ddd910dd545c45a7227da87ca125758b4a0e2cb (patch) | |
| tree | b652bb239c622e2f8806a443db21a0b0bf8c8962 /internal/bible/crosschapter_test.go | |
| parent | 79f9ae051c1e8f179e2e7c17f590c105eb18bef1 (diff) | |
| download | lectio-8ddd910dd545c45a7227da87ca125758b4a0e2cb.tar.gz lectio-8ddd910dd545c45a7227da87ca125758b4a0e2cb.zip | |
test(bible): skip corpus-dependent tests when optional corpora aren't embedded
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.
Diffstat (limited to 'internal/bible/crosschapter_test.go')
| -rw-r--r-- | internal/bible/crosschapter_test.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/internal/bible/crosschapter_test.go b/internal/bible/crosschapter_test.go index 7fb61eb..20074fb 100644 --- a/internal/bible/crosschapter_test.go +++ b/internal/bible/crosschapter_test.go @@ -8,6 +8,7 @@ import "testing" // both chapters via Lookup, and format back to the clean "N:M-P:Q" form via // FormatRef (no sentinel, no mangled chapter). func TestCrossChapterRanges(t *testing.T) { + requireCorpus(t, "drb") tbl, err := LoadBookTable(nil) if err != nil { t.Fatal(err) @@ -90,6 +91,7 @@ func TestCrossChapterRanges(t *testing.T) { // "Malachi 1:14-2:2,8-10" (Ordinary Sunday 31 A): a cross-chapter range // followed by a plain verse group in the new (second) chapter. func TestCrossChapterRangeWithTrailingGroup(t *testing.T) { + requireCorpus(t, "drb") tbl, err := LoadBookTable(nil) if err != nil { t.Fatal(err) |
