aboutsummaryrefslogtreecommitdiff
path: root/internal/bible/convert_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 12:55:24 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-23 12:55:24 +0200
commit343a675a5a779cfce5a3dec9a3ad4a6ffb22de75 (patch)
tree744fb2877695f9b02cc8834c098cd3404d25650a /internal/bible/convert_test.go
parent0fd209b654b057efa281f86d7bfd5043a12ce407 (diff)
downloadlectio-343a675a5a779cfce5a3dec9a3ad4a6ffb22de75.tar.gz
lectio-343a675a5a779cfce5a3dec9a3ad4a6ffb22de75.zip
bible: Polish citation -> English ref (with psalm versification)
Diffstat (limited to 'internal/bible/convert_test.go')
-rw-r--r--internal/bible/convert_test.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/bible/convert_test.go b/internal/bible/convert_test.go
new file mode 100644
index 0000000..6f16c89
--- /dev/null
+++ b/internal/bible/convert_test.go
@@ -0,0 +1,19 @@
+package bible
+
+import "testing"
+
+func TestToEnglishRef(t *testing.T) {
+ cases := []struct{ in, system, want string }{
+ {"Mt 7, 1-5", "vulgate", "Mat 7:1-5"},
+ {"J 20, 1. 11-18", "vulgate", "John 20:1,11-18"},
+ {"por. J 20, 11", "vulgate", "John 20:11"},
+ {"Ps 63 (62), 2. 3-4. 5-6. 8-9 (R.: por. 2ab)", "vulgate", "Psalms 62:2,3-4,5-6,8-9"},
+ {"Ps 63 (62), 2. 3-4. 5-6. 8-9 (R.: por. 2ab)", "drb", "Psalms 63:1,2-3,4-5,7-8"},
+ }
+ for _, c := range cases {
+ got, err := ToEnglishRef(c.in, c.system)
+ if err != nil || got != c.want {
+ t.Errorf("ToEnglishRef(%q,%q)=%q,%v want %q", c.in, c.system, got, err, c.want)
+ }
+ }
+}