1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-02-09 22:46:04 +00:00

test: Update fuzz tests to use the built-in infrastructure

Go 1.18 supports fuzzing natively, so this patch migrates our fuzzing
tests to make use of it.
This commit is contained in:
Alberto Bertogli
2023-02-05 12:30:25 +00:00
parent a54d81f406
commit efefee9fbb
88 changed files with 246 additions and 470 deletions

View File

@@ -1,6 +1,7 @@
package aliases
import (
"bytes"
"errors"
"os"
"os/exec"
@@ -482,3 +483,10 @@ func TestHookError(t *testing.T) {
t.Errorf("expected *exec.ExitError, got %T - %v", err, err)
}
}
// Fuzz testing for the parser.
func FuzzReader(f *testing.F) {
f.Fuzz(func(t *testing.T, data []byte) {
parseReader("domain", bytes.NewReader(data))
})
}