Server : LiteSpeed System : Linux in-mum-web1333.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64 User : u141265441 ( 141265441) PHP Version : 8.4.3 Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail Directory : /proc/self/root/opt/golang/1.22.0/src/cmd/go/testdata/script/ |
[!fuzz] skip
[short] skip
env GOCACHE=$WORK/cache
# Run chatty fuzz targets with an error.
! go test -v chatty_error_fuzz_test.go
! stdout '^ok'
stdout 'FAIL'
stdout 'error in target'
# Run chatty fuzz targets with a fatal.
! go test -v chatty_fatal_fuzz_test.go
! stdout '^ok'
stdout 'FAIL'
stdout 'fatal in target'
# Run chatty fuzz target with a panic
! go test -v chatty_panic_fuzz_test.go
! stdout ^ok
stdout FAIL
stdout 'this is bad'
# Run skipped chatty fuzz targets.
go test -v chatty_skipped_fuzz_test.go
stdout ok
stdout SKIP
! stdout FAIL
# Run successful chatty fuzz targets.
go test -v chatty_fuzz_test.go
stdout ok
stdout PASS
stdout 'all good here'
! stdout FAIL
# Fuzz successful chatty fuzz target that includes a separate unit test.
go test -v chatty_with_test_fuzz_test.go -fuzz=Fuzz -fuzztime=1x
stdout ok
stdout PASS
! stdout FAIL
stdout -count=1 'all good here'
# Verify that the unit test is only run once.
stdout -count=1 'logged foo'
-- chatty_error_fuzz_test.go --
package chatty_error_fuzz
import "testing"
func Fuzz(f *testing.F) {
f.Error("error in target")
}
-- chatty_fatal_fuzz_test.go --
package chatty_fatal_fuzz
import "testing"
func Fuzz(f *testing.F) {
f.Fatal("fatal in target")
}
-- chatty_panic_fuzz_test.go --
package chatty_panic_fuzz
import "testing"
func Fuzz(f *testing.F) {
panic("this is bad")
}
-- chatty_skipped_fuzz_test.go --
package chatty_skipped_fuzz
import "testing"
func Fuzz(f *testing.F) {
f.Skip()
}
-- chatty_fuzz_test.go --
package chatty_fuzz
import "testing"
func Fuzz(f *testing.F) {
f.Log("all good here")
f.Fuzz(func(*testing.T, []byte) {})
}
-- chatty_with_test_fuzz_test.go --
package chatty_with_test_fuzz
import "testing"
func TestFoo(t *testing.T) {
t.Log("logged foo")
}
func Fuzz(f *testing.F) {
f.Log("all good here")
f.Fuzz(func(*testing.T, []byte) {})
}