diff options
Diffstat (limited to 'internal/config/config_test.go')
| -rw-r--r-- | internal/config/config_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/config/config_test.go b/internal/config/config_test.go index e3af475..3830cb6 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -301,3 +301,23 @@ func TestPartShown(t *testing.T) { t.Error("ewangelia not mentioned should still be shown") } } + +func TestReadingCorpusResolution(t *testing.T) { + // drb is an embedded corpus with lang=en. + c := Config{ReadingVersion: "drb"} + if got := c.ReadingCorpus(); got != "drb" { + t.Fatalf("explicit reading_version: got %q", got) + } + c = Config{ReadingLang: "en"} + if got := c.ReadingCorpus(); got != "drb" { + t.Fatalf("reading_lang match: got %q", got) + } + c = Config{UILanguage: "en"} + if got := c.ReadingCorpus(); got != "drb" { + t.Fatalf("ui_language fallback: got %q", got) + } + c = Config{UILanguage: "pl"} // no pl corpus embedded + if got := c.ReadingCorpus(); got != "" { + t.Fatalf("no match should be empty: got %q", got) + } +} |
