Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestCheckProperty (0.22 sec)

  1. src/testing/quick/quick_test.go

    	x int
    }
    
    func (m myStruct) Generate(r *rand.Rand, _ int) reflect.Value {
    	return reflect.ValueOf(myStruct{x: 42})
    }
    
    func myStructProperty(in myStruct) bool { return in.x == 42 }
    
    func TestCheckProperty(t *testing.T) {
    	reportError("myStructProperty", Check(myStructProperty, nil), t)
    }
    
    func TestFailure(t *testing.T) {
    	f := func(x int) bool { return false }
    	err := Check(f, nil)
    	if err == nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 12:54:00 UTC 2019
    - 9K bytes
    - Viewed (0)
Back to top