diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 14:59:14 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 14:59:14 +0200 |
| commit | cb3379f41c06a94085c77fe359709b46712850dc (patch) | |
| tree | 032801111764c83c3ab089ed101ba4d1222a9abd /internal/web/server_test.go | |
| parent | a13dd6224a095242da54062e4775570c4f16a718 (diff) | |
| download | lectio-cb3379f41c06a94085c77fe359709b46712850dc.tar.gz lectio-cb3379f41c06a94085c77fe359709b46712850dc.zip | |
feat: books.toml -> books.ini, multi-language (add Latin dialect), config-scoped citation display
books.ini with [en]/[pl]/[la]; parseBooks reads INI (bible drops go-toml).
Latin dialect resolves EF citations (Eccli->Sirach, Apoc->Revelation, Luc...);
sigla_style gains 'latin'. Reading citations now DISPLAY in the configured
sigla (FormatRef(SiglaLang)), not raw English. One-shot books.toml->books.ini
user migration (go-toml now config-only). Web settings editor -> books.ini.
Diffstat (limited to 'internal/web/server_test.go')
| -rw-r--r-- | internal/web/server_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/web/server_test.go b/internal/web/server_test.go index 284a454..12542e5 100644 --- a/internal/web/server_test.go +++ b/internal/web/server_test.go @@ -561,19 +561,19 @@ func TestSettingsPostInvalidBooks(t *testing.T) { post.Header.Set("Content-Type", "application/x-www-form-urlencoded") rec := httptest.NewRecorder() srv.ServeHTTP(rec, post) - if rec.Code != 200 || !strings.Contains(rec.Body.String(), "books.toml") { + if rec.Code != 200 || !strings.Contains(rec.Body.String(), "books.ini") { t.Errorf("invalid books should re-render with an error, got %d", rec.Code) } } -func bibleDefaultBooks() []byte { return bible.DefaultBooksTOML() } +func bibleDefaultBooks() []byte { return bible.DefaultBooksINI() } // TestSettingsPostEmptyBooksPreservesFile guards that a submit without a books -// field never clobbers an existing books.toml override. +// field never clobbers an existing books.ini override. func TestSettingsPostEmptyBooksPreservesFile(t *testing.T) { dir := t.TempDir() t.Setenv("LECTIO_CONFIG", filepath.Join(dir, "config.toml")) - booksPath := filepath.Join(dir, "books.toml") + booksPath := filepath.Join(dir, "books.ini") original := []byte("[en]\nJohn = [\"Jn\", \"John\"]\n") if err := os.WriteFile(booksPath, original, 0o644); err != nil { t.Fatal(err) @@ -594,7 +594,7 @@ func TestSettingsPostEmptyBooksPreservesFile(t *testing.T) { t.Fatalf("status %d", rec.Code) } if got, _ := os.ReadFile(booksPath); string(got) != string(original) { - t.Errorf("empty books submit clobbered books.toml: got %q", got) + t.Errorf("empty books submit clobbered books.ini: got %q", got) } } |
