diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 20:29:31 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 20:29:31 +0200 |
| commit | 0bcddd4ed0aff66452397dc0973337c535c0d2ed (patch) | |
| tree | fffae4df5ba0efe80c0f7c2501ebf0396e438fdd /internal/bible/validate_test.go | |
| parent | 399f0d428050ee104f16e8d4a289b65a4a68eb13 (diff) | |
| download | lectio-0bcddd4ed0aff66452397dc0973337c535c0d2ed.tar.gz lectio-0bcddd4ed0aff66452397dc0973337c535c0d2ed.zip | |
feat(cli): lectio --corpus-check validator
Diffstat (limited to 'internal/bible/validate_test.go')
| -rw-r--r-- | internal/bible/validate_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
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") + } +} |
