aboutsummaryrefslogtreecommitdiff
path: root/src/testing/fuzz.go
diff options
context:
space:
mode:
authorSean Liao <sean@liao.dev>2025-04-29 16:54:06 +0100
committerGopher Robot <gobot@golang.org>2025-04-30 08:21:07 -0700
commit8270b858ee8744e5b7584b49ae6ed93aa975c8bc (patch)
treeb93512ebbd0c93cdfedc993676273ca7cea0a1bc /src/testing/fuzz.go
parent1e756dc5f73dc19eb1cbf038807d18ef1cc54ebc (diff)
downloadgo-8270b858ee8744e5b7584b49ae6ed93aa975c8bc.tar.xz
testing: use more doc links
Change-Id: Ide372735165b7510fd8d7588451a37fa743e59c1 Reviewed-on: https://go-review.googlesource.com/c/go/+/668915 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Commit-Queue: Alan Donovan <adonovan@google.com> Reviewed-by: Alan Donovan <adonovan@google.com> Auto-Submit: Alan Donovan <adonovan@google.com> Reviewed-by: Carlos Amedee <carlos@golang.org>
Diffstat (limited to 'src/testing/fuzz.go')
-rw-r--r--src/testing/fuzz.go22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/testing/fuzz.go b/src/testing/fuzz.go
index dceb786ae2..0e04aff6e7 100644
--- a/src/testing/fuzz.go
+++ b/src/testing/fuzz.go
@@ -57,15 +57,15 @@ type InternalFuzzTarget struct {
// find and report potential bugs in the code being tested.
//
// A fuzz test runs the seed corpus by default, which includes entries provided
-// by (*F).Add and entries in the testdata/fuzz/<FuzzTestName> directory. After
-// any necessary setup and calls to (*F).Add, the fuzz test must then call
-// (*F).Fuzz to provide the fuzz target. See the testing package documentation
+// by [F.Add] and entries in the testdata/fuzz/<FuzzTestName> directory. After
+// any necessary setup and calls to [F.Add], the fuzz test must then call
+// [F.Fuzz] to provide the fuzz target. See the testing package documentation
// for an example, and see the [F.Fuzz] and [F.Add] method documentation for
// details.
//
-// *F methods can only be called before (*F).Fuzz. Once the test is
-// executing the fuzz target, only (*T) methods can be used. The only *F methods
-// that are allowed in the (*F).Fuzz function are (*F).Failed and (*F).Name.
+// *F methods can only be called before [F.Fuzz]. Once the test is
+// executing the fuzz target, only [*T] methods can be used. The only *F methods
+// that are allowed in the [F.Fuzz] function are [F.Failed] and [F.Name].
type F struct {
common
fstate *fuzzState
@@ -185,7 +185,7 @@ var supportedTypes = map[reflect.Type]bool{
// Fuzz runs the fuzz function, ff, for fuzz testing. If ff fails for a set of
// arguments, those arguments will be added to the seed corpus.
//
-// ff must be a function with no return value whose first argument is *T and
+// ff must be a function with no return value whose first argument is [*T] and
// whose remaining arguments are the types to be fuzzed.
// For example:
//
@@ -195,9 +195,9 @@ var supportedTypes = map[reflect.Type]bool{
// float64, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64.
// More types may be supported in the future.
//
-// ff must not call any *F methods, e.g. (*F).Log, (*F).Error, (*F).Skip. Use
-// the corresponding *T method instead. The only *F methods that are allowed in
-// the (*F).Fuzz function are (*F).Failed and (*F).Name.
+// ff must not call any [*F] methods, e.g. [F.Log], [F.Error], [F.Skip]. Use
+// the corresponding [*T] method instead. The only [*F] methods that are allowed in
+// the F.Fuzz function are [F.Failed] and [F.Name].
//
// This function should be fast and deterministic, and its behavior should not
// depend on shared state. No mutable input arguments, or pointers to them,
@@ -207,7 +207,7 @@ var supportedTypes = map[reflect.Type]bool{
//
// When fuzzing, F.Fuzz does not return until a problem is found, time runs out
// (set with -fuzztime), or the test process is interrupted by a signal. F.Fuzz
-// should be called exactly once, unless F.Skip or [F.Fail] is called beforehand.
+// should be called exactly once, unless [F.Skip] or [F.Fail] is called beforehand.
func (f *F) Fuzz(ff any) {
if f.fuzzCalled {
panic("testing: F.Fuzz called more than once")