mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-19 14:57: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:
@@ -128,3 +128,27 @@ func TestDomainToUnicode(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func FuzzUser(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, user string) {
|
||||
User(user)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzDomain(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, domain string) {
|
||||
Domain(domain)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzAddr(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, addr string) {
|
||||
Addr(addr)
|
||||
})
|
||||
}
|
||||
|
||||
func FuzzDomainToUnicode(f *testing.F) {
|
||||
f.Fuzz(func(t *testing.T, addr string) {
|
||||
DomainToUnicode(addr)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user