Skip to content

Fix randomization for enums with single value #161

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

Merged

Conversation

gsamokovarov
Copy link
Contributor

Hey there,

I hit a bug that panicked the generated tests with:

panic: invalid argument to Intn

The problem happened, because I have a Postgres ENUM with a single
value, that caused a rand.Intn(0) call, which panics on zero.

See: https://golang.org/src/math/rand/rand.go?s=4112:4142#L129

Hey there,

I hit a bug that panicked the tests with:

    panic: invalid argument to Intn

The problem happened, because I have a Postgres `ENUM` with a single
value, that caused a `rand.Intn(0)` call, which panics on zero.

See: https://golang.org/src/math/rand/rand.go?s=4112:4142#L129
@nullbio
Copy link
Member

nullbio commented Jun 14, 2017

Thank you for fixing this. @aarondl Looks good to merge, yeah?

Copy link
Member

@aarondl aarondl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aarondl aarondl merged commit 64206cf into volatiletech:dev Jun 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants