From 0bcddd4ed0aff66452397dc0973337c535c0d2ed Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Mon, 27 Jul 2026 20:29:31 +0200 Subject: feat(cli): lectio --corpus-check validator --- internal/bible/validate_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 internal/bible/validate_test.go (limited to 'internal/bible/validate_test.go') diff --git a/internal/bible/validate_test.go b/internal/bible/validate_test.go new file mode 100644 index 0000000..9cfec26 --- /dev/null +++ b/internal/bible/validate_test.go @@ -0,0 +1,24 @@ +package bible + +import "testing" + +func TestCheckCorpus(t *testing.T) { + SetUserCorporaDir("testdata/corpora") + t.Cleanup(func() { SetUserCorporaDir("") }) + + if r := CheckCorpus("good"); !r.OK() { + t.Fatalf("good corpus flagged: %v", r.Errors) + } + if r := CheckCorpus("badbook"); r.OK() { + t.Fatal("unknown book not caught") + } + if r := CheckCorpus("gap"); len(r.Warnings) == 0 { + t.Fatal("verse gap not warned") + } + if r := CheckCorpus("nosidecar"); r.OK() { + t.Fatal("missing sidecar not caught") + } + if r := CheckCorpus("badsystem"); r.OK() { + t.Fatal("bad psalm_system not caught") + } +} -- cgit v1.3