github.com/leanovate/gopter@v0.2.9/gen/ptr_shrink_test.go (about) 1 package gen_test 2 3 import ( 4 "reflect" 5 "testing" 6 7 "github.com/leanovate/gopter/gen" 8 ) 9 10 func TestPtrShrinker(t *testing.T) { 11 v := 10 12 shinks := []int{0, 5, -5, 8, -8, 9, -9} 13 intPtrShrink := gen.PtrShrinker(gen.IntShrinker)(&v).All() 14 if !reflect.DeepEqual(intPtrShrink, []interface{}{nil, &shinks[0], &shinks[1], &shinks[2], &shinks[3], &shinks[4], &shinks[5], &shinks[6]}) { 15 t.Errorf("Invalid intPtrShrink: %#v", intPtrShrink) 16 } 17 }