diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-23 12:44:59 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-23 12:44:59 +0200 |
| commit | 4273441011c9e29c2d7c387fc008d0b7b82f33d8 (patch) | |
| tree | cbda84e1892c346c784bb9b6a81796b1ccab8626 /internal/bible/books_test.go | |
| parent | ab71c67414666800f19fdd3f6515f15c90cb822e (diff) | |
| download | lectio-4273441011c9e29c2d7c387fc008d0b7b82f33d8.tar.gz lectio-4273441011c9e29c2d7c387fc008d0b7b82f33d8.zip | |
bible: canonical books + alias resolution
Diffstat (limited to 'internal/bible/books_test.go')
| -rw-r--r-- | internal/bible/books_test.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/internal/bible/books_test.go b/internal/bible/books_test.go new file mode 100644 index 0000000..43a67cf --- /dev/null +++ b/internal/bible/books_test.go @@ -0,0 +1,26 @@ +package bible + +import "testing" + +func TestResolveBook(t *testing.T) { + cases := []struct{ in, want string }{ + {"John", "John"}, + {"Joh", "John"}, // English prefix + {"J", "John"}, // Polish abbrev — NOT Joshua + {"Łk", "Luke"}, + {"1 Kor", "1 Corinthians"}, + {"Jana", "John"}, + {"Rodzaju", "Genesis"}, + {"Mdr", "Wisdom"}, + {"Pnp", "Song of Solomon"}, + {"Dz", "The Acts"}, + } + for _, c := range cases { + if got, ok := ResolveBook(c.in); !ok || got != c.want { + t.Errorf("ResolveBook(%q)=%q,%v want %q", c.in, got, ok, c.want) + } + } + if _, ok := ResolveBook("Nonsense"); ok { + t.Error("ResolveBook(Nonsense) should fail") + } +} |
