Test that New without WithSeed fails naming it, that the CLI without --seed draws afresh each run, and seed every test's New

This commit is contained in:
2026-10-12 18:10:57 +02:00
committed by Lillem4n
parent 1a5b632b90
commit 3ae8b9f1b1
19 changed files with 91 additions and 87 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ func TestAnOptionOfTheWrongKindIsNamedByItsJSONKind(t *testing.T) {
t.Errorf("compile(%s) = %v, want %q", src, err, want)
}
}
_, err := New(WithDataPath(writeFiles(t, map[string]string{"t.json": `{"format":"{a}","rows":"t.tsv","key":5}`, "t.tsv": "a\nx\n"})))
_, err := New(WithSeed(1), WithDataPath(writeFiles(t, map[string]string{"t.json": `{"format":"{a}","rows":"t.tsv","key":5}`, "t.tsv": "a\nx\n"})))
if err == nil || !strings.Contains(err.Error(), "key must be a string, not a number") {
t.Errorf("key 5 = %v, want the kind named", err)
}