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:
+1
-1
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user