From 4273441011c9e29c2d7c387fc008d0b7b82f33d8 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Thu, 23 Jul 2026 12:44:59 +0200 Subject: bible: canonical books + alias resolution --- internal/bible/books_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 internal/bible/books_test.go (limited to 'internal/bible/books_test.go') 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") + } +} -- cgit v1.3