aboutsummaryrefslogtreecommitdiff
path: root/internal/cli/cli_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cli/cli_test.go')
-rw-r--r--internal/cli/cli_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/internal/cli/cli_test.go b/internal/cli/cli_test.go
index 3b99562..b08ffba 100644
--- a/internal/cli/cli_test.go
+++ b/internal/cli/cli_test.go
@@ -318,6 +318,20 @@ func TestListFlag(t *testing.T) {
}
}
+func TestListSurfacesUserCorpus(t *testing.T) {
+ bible.SetUserCorporaDir("../bible/testdata/corpora")
+ t.Cleanup(func() { bible.SetUserCorporaDir("") })
+
+ tbl, _ := bible.LoadBookTable(nil)
+ var out bytes.Buffer
+ if code := runList(tbl, "en", &out); code != 0 {
+ t.Fatalf("runList code=%d", code)
+ }
+ if s := out.String(); !strings.Contains(s, "good") || !strings.Contains(s, "Good Test Corpus") {
+ t.Errorf("--list did not surface the user fixture corpus:\n%s", s)
+ }
+}
+
func TestRefEnglishDialect(t *testing.T) {
var out, errb bytes.Buffer
if code := Run([]string{"-p", "Jn 3:16", "-b", "vul"}, nil, &out, &errb); code != 0 {