package quick

Import Path
	testing/quick (on golang.org and go.dev)

Dependency Relation
	imports 7 packages, and imported by 0 packages

Involved Source Files
	d-> quick.go

Exported Type Names

type CheckEqualError (struct) A CheckEqualError is the result CheckEqual finding an error. CheckError CheckError CheckError.Count int CheckError.In []interface{} Out1 []interface{} Out2 []interface{} (*T) Error() string *T : error
type CheckError (struct) A CheckError is the result of Check finding an error. Count int In []interface{} (*T) Error() string *T : error
type Config (struct) A Config structure contains options for running a test. MaxCount int MaxCountScale float64 Rand *rand.Rand Values func([]reflect.Value, *rand.Rand) func Check(f interface{}, config *Config) error func CheckEqual(f, g interface{}, config *Config) error
type Generator (interface) A Generator can generate random values of its own type. (T) Generate(rand *rand.Rand, size int) reflect.Value
type SetupError string A SetupError is the result of an error in the way that check is being used, independent of the functions being tested. (T) Error() string T : error
Exported Values
func Check(f interface{}, config *Config) error Check looks for an input to f, any function that returns bool, such that f returns false. It calls f repeatedly, with arbitrary values for each argument. If f returns false on a given input, Check returns that input as a *CheckError. For example: func TestOddMultipleOfThree(t *testing.T) { f := func(x int) bool { y := OddMultipleOfThree(x) return y%2 == 1 && y%3 == 0 } if err := quick.Check(f, nil); err != nil { t.Error(err) } }
func CheckEqual(f, g interface{}, config *Config) error CheckEqual looks for an input on which f and g return different results. It calls f and g repeatedly with arbitrary values for each argument. If f and g return different answers, CheckEqual returns a *CheckEqualError describing the input and the outputs.
func Value(t reflect.Type, rand *rand.Rand) (value reflect.Value, ok bool) Value returns an arbitrary value of the given type. If the type implements the Generator interface, that will be used. Note: To create arbitrary values for structs, all the fields must be exported.