Use testing.F on FuzzPlatformsParse

Signed-off-by: Kazuyoshi Kato <katokazu@amazon.com>
This commit is contained in:
Kazuyoshi Kato
2022-06-13 17:17:26 +00:00
parent 57200edf25
commit a1eb2d8a67
3 changed files with 11 additions and 33 deletions

View File

@@ -364,3 +364,13 @@ func TestParseSelectorInvalid(t *testing.T) {
})
}
}
func FuzzPlatformsParse(f *testing.F) {
f.Add("linux/amd64")
f.Fuzz(func(t *testing.T, s string) {
pf, err := Parse(s)
if err != nil && (pf.OS != "" || pf.Architecture != "") {
t.Errorf("either %+v or %+v must be nil", err, pf)
}
})
}