10 "github.com/anacrolix/torrent/bencode"
13 func Fuzz(f *testing.F) {
14 // Is there an OS-agnostic version of Glob?
15 matches, err := filepath.Glob(filepath.FromSlash("testdata/*.torrent"))
19 for _, m := range matches {
20 b, err := os.ReadFile(m)
24 f.Logf("adding %q", m)
27 f.Fuzz(func(t *testing.T, b []byte) {
29 err := bencode.Unmarshal(b, &mi)
33 _, err = bencode.Marshal(mi)
37 info, err := mi.UnmarshalInfo()
41 _, err = bencode.Marshal(info)