Test blank stdin rendering, a category reading itself as a fresh draw, a bare number or boolean refused in a record column, a one-item choice of weight 0 refused, and a hidden rows file read

This commit is contained in:
2026-10-08 11:48:08 +02:00
committed by Lillem4n
parent 66509abf1e
commit dd09d7ae82
6 changed files with 62 additions and 27 deletions
+12
View File
@@ -86,6 +86,18 @@ func TestWalkIgnoresARowsFileNoCategoryNames(t *testing.T) {
}
}
func TestARowsFileMayBeHidden(t *testing.T) {
var rows string
err := Source{fsys: fstest.MapFS{"a.json": {Data: []byte(`"x"`)}, ".a.tsv": {Data: []byte("key\nA\n")}}}.Walk(func(c Category) error {
var err error
rows, err = c.ReadRows(".a.tsv")
return err
})
if err != nil || rows != "key\nA\n" {
t.Errorf("Walk = %v, read %q, want the hidden rows file read", err, rows)
}
}
func TestWalkLabelsWhatACategoryFileGetsWrong(t *testing.T) {
for _, c := range []struct {
name string