Test that the help's examples read no data and list the exit codes, a data path that is no directory says so in one shape, a choice suggests a record of one, a JSON syntax error names its line and column, and FakeStruct says no data is loaded

This commit is contained in:
2026-10-11 23:27:33 +02:00
committed by Lillem4n
parent 780586ad68
commit 1a7656d076
6 changed files with 44 additions and 12 deletions
+1 -1
View File
@@ -205,7 +205,7 @@ func TestNewErrors(t *testing.T) {
if err := os.WriteFile(file, []byte("{}"), 0o644); err != nil {
t.Fatal(err)
}
if _, err := New(WithDataPath(file)); err == nil || !strings.Contains(err.Error(), "xx_XX is not a directory") {
if _, err := New(WithDataPath(file)); err == nil || !strings.Contains(err.Error(), "xx_XX: not a directory") {
t.Errorf("New(file) = %v, want not-a-directory error", err)
}
// Invalid JSON in a category file fails.