-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arbitraries.GenForType does not support arrays #86
Comments
Can you provide a short example to reproduce this? |
will print |
Can you check if the current master branch fixes your problem? |
Yes, this fixes array support, but it would still be a nice quality of life change if passing an unsupported type to Also there is a typo in the |
I'm sorry, it seems panicking on unsupported types is a breaking change. Since struct types ignore unsupported fields it means anyone generating structs with unsupported fields now gets a panic instead. It's fine for the map/slice/array versions but structs explicitly ignore fields https://github.com/leanovate/gopter/blob/master/arbitrary/gen_for_kind.go#L331 if GenForType returns nil. Sorry for the shortsightedness, maybe we can move the check into |
Removed the panic for now, have to dig a bit deeper into the ForAll |
passing an array type to
GenForType
returns nil, and this only panics once the properties are actually ran so it isn't obvious what the issue is, it produces the following stack trace:GenForType
should probably panic if there is an unsupported typeThe text was updated successfully, but these errors were encountered: