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
+6
View File
@@ -89,6 +89,12 @@ func TestAGeneratorWithNoDataRendersWhatReadsNone(t *testing.T) {
if _, err := f.FakeRecord("x"); err == nil || !strings.Contains(err.Error(), "no data is loaded") {
t.Errorf("%s: FakeRecord(x) = %v, want a reference to nothing refused, saying no data is loaded", name, err)
}
var tagged struct {
X string `fake:"x"`
}
if err := f.FakeStruct(&tagged); err == nil || !strings.Contains(err.Error(), "no data is loaded") {
t.Errorf("%s: FakeStruct(tag x) = %v, want a reference to nothing refused, saying no data is loaded", name, err)
}
}
}