README ¶ pter Go Property Tester base on testing/quick. usage $ go get github.com/a3d21/pter example func TestAddSpec(t *testing.T) { add := func(a, b int) int { return a + b } assertion := func(a, b int) bool { return add(a, b) == a+b } QuickCheck(t, assertion, nil) } Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func QuickCheck(t *testing.T, assertion interface{}, c *Config) type ArgsFn func FuzzArgs(fuzzer *fuzz.Fuzzer, assertion interface{}) ArgsFn func (f ArgsFn) ToQuickValueFn() func(values []reflect.Value, rand *rand.Rand) type Config Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func QuickCheck ¶ func QuickCheck(t *testing.T, assertion interface{}, c *Config) Types ¶ type ArgsFn ¶ added in v0.0.2 type ArgsFn func() []interface{} ArgsFn generate test args func FuzzArgs ¶ func FuzzArgs(fuzzer *fuzz.Fuzzer, assertion interface{}) ArgsFn FuzzArgs fuzz non-nil args generator for testing/quick func (ArgsFn) ToQuickValueFn ¶ added in v0.0.2 func (f ArgsFn) ToQuickValueFn() func(values []reflect.Value, rand *rand.Rand) ToQuickValueFn transform to testing/quick value fn type Config ¶ added in v0.0.2 type Config struct { // MaxCount sets the maximum test count MaxCount int // Args generator Args ArgsFn // Fuzzer generate args, use `defaultFuzzer` when Fuzzer==nil Fuzzer *fuzz.Fuzzer } Source Files ¶ View all Source files pter.goutil.go Click to show internal directories. Click to hide internal directories.