1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-18 14:47:03 +00:00

aliases: Fuzz testing

This commit is contained in:
Alberto Bertogli
2017-04-22 14:50:39 +01:00
parent f73b889016
commit e543a03feb
7 changed files with 64 additions and 5 deletions

22
internal/aliases/fuzz.go Normal file
View File

@@ -0,0 +1,22 @@
// Fuzz testing for package aliases.
// +build gofuzz
package aliases
import "bytes"
func Fuzz(data []byte) int {
interesting := 0
aliases, _ := parseReader("domain", bytes.NewReader(data))
// Mark cases with actual aliases as more interesting.
for _, rcpts := range aliases {
if len(rcpts) > 0 {
interesting = 1
break
}
}
return interesting
}