blob: a0e9d0c0e6bb6a2416c2d342590123b510af4e83 [file] [log] [blame]
Damien Neil26451c02019-12-19 14:17:21 -08001// Copyright 2019 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5package textfuzz
6
7import (
8 "io/ioutil"
9 "os"
10 "path/filepath"
11 "testing"
12)
13
14func Test(t *testing.T) {
15 dir, err := os.Open("corpus")
16 if err != nil {
17 t.Fatal(err)
18 }
19 infos, err := dir.Readdir(0)
20 if err != nil {
21 t.Fatal(err)
22
23 }
24 for _, info := range infos {
25 name := info.Name()
26 t.Run(name, func(t *testing.T) {
27 b, err := ioutil.ReadFile(filepath.Join("corpus", name))
28 if err != nil {
29 t.Fatal(err)
30 }
31 Fuzz(b)
32 })
33 }
34}