github.com/leanovate/gopter@v0.2.9/prop/error_test.go (about) 1 package prop_test 2 3 import ( 4 "errors" 5 "testing" 6 7 "github.com/leanovate/gopter" 8 "github.com/leanovate/gopter/prop" 9 ) 10 11 func TestErrorProp(t *testing.T) { 12 p := prop.ErrorProp(errors.New("Booom")) 13 result := p(gopter.DefaultGenParameters()) 14 15 if result.Status != gopter.PropError || result.Error == nil || result.Error.Error() != "Booom" { 16 t.Errorf("Invalid error prop result: %#v", result) 17 } 18 }