...

Text file src/cmd/go/testdata/script/test_fuzz_return.txt

Documentation: cmd/go/testdata/script

     1[short] skip
     2
     3! go test .
     4stdout '^panic: testing: fuzz target must not return a value \[recovered\]$'
     5
     6-- go.mod --
     7module test
     8go 1.18
     9-- x_test.go --
    10package test
    11
    12import "testing"
    13
    14func FuzzReturnErr(f *testing.F) {
    15	f.Add("hello, validation!")
    16	f.Fuzz(func(t *testing.T, in string) string {
    17		return in
    18	})
    19}

View as plain text