diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 11:29:57 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-24 11:29:57 +0200 |
| commit | a26fed000ad9f292618f9cecfd2b505dddfd004a (patch) | |
| tree | 3b6001cc5a20c3451677773159553aa134d4a6c9 /internal/config/config_test.go | |
| parent | e50b003d84b091b60c8028468edc633f04e39731 (diff) | |
| download | lectio-a26fed000ad9f292618f9cecfd2b505dddfd004a.tar.gz lectio-a26fed000ad9f292618f9cecfd2b505dddfd004a.zip | |
books: language-scoped --ref/--list via customizable books.toml + sigla_style config; v0.7.0
Diffstat (limited to 'internal/config/config_test.go')
| -rw-r--r-- | internal/config/config_test.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go index a72383b..cc0c941 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -178,6 +178,27 @@ func TestPagerLoadsSetting(t *testing.T) { } } +func TestSiglaStyleDefaultsAndDialect(t *testing.T) { + if got := Default().SiglaStyle; got != "auto" { + t.Errorf("default SiglaStyle=%q want auto", got) + } + cases := []struct{ style, ui, want string }{ + {"auto", "en", "en"}, + {"auto", "pl", "pl"}, + {"polish", "en", "pl"}, + {"english", "pl", "en"}, + } + for _, c := range cases { + cfg := Config{SiglaStyle: NormalizeSiglaStyle(c.style), UILanguage: c.ui} + if got := cfg.SiglaLang(); got != c.want { + t.Errorf("SiglaLang(style=%q,ui=%q)=%q want %q", c.style, c.ui, got, c.want) + } + } + if NormalizeSiglaStyle("nonsense") != "auto" { + t.Error("unknown sigla_style should normalize to auto") + } +} + func TestPartShown(t *testing.T) { var empty Config if !empty.PartShown("new", "psalm") { |
