Skip to content
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

Gen.chooseNum(0, Int.MaxValue) sometimes gives -1073741823 #338

Closed
shawjef3 opened this issue Jun 16, 2017 · 11 comments
Closed

Gen.chooseNum(0, Int.MaxValue) sometimes gives -1073741823 #338

shawjef3 opened this issue Jun 16, 2017 · 11 comments

Comments

@shawjef3
Copy link

I would expect this to not give any negative values.

@shawjef3
Copy link
Author

shawjef3 commented Jun 16, 2017

As a work around, I'm using Gen.choose(0, Int.MaxValue).

@shawjef3
Copy link
Author

Actually, Gen.choose isn't a good workaround, because it doesn't test extrema.

@shawjef3
Copy link
Author

I'm using scalacheck 1.13.5 for scala 2.11.

@Philippus
Copy link
Contributor

Philippus commented Jul 22, 2018

could you share an example? So far, I cannot reproduce this. Maybe it happened during shrinking?

@ashawley
Copy link
Contributor

Agree. I cant 'get the most naive test of this to fail:

    Prop.forAll(Gen.choose(0, Int.MaxValue)) { x: Int =>
      0 <= x && x <= Int.MaxValue
    }

When I intentionally modified the test so it fails, I did see that the shrinking could produce a negative.

> ARG_0: -1
> ARG_0_ORIGINAL: 1967653363

That's a known issue with shrinkers, see #129, not with the generators.

@pford19
Copy link

pford19 commented Sep 12, 2018

Curious about issue tracking and lifecycle process. Why is this issue still in Open status?

@rickynils
Copy link
Contributor

@pford19 Lack of time. I want to bring in more maintainers and get better project management for ScalaCheck, but I have unfortunately not time for that either.

@pford19
Copy link

pford19 commented Sep 13, 2018

:-)

@SethTisue
Copy link
Member

sounds like maybe we should just close this, since there's no clear issue here that isn't #129?

@non
Copy link
Contributor

non commented Sep 3, 2019

Agreed, I think that issue tracks the problem, and -disableLegacyShrinking is a work around for it.

@non non closed this as completed Sep 3, 2019
@plokhotnyuk
Copy link

@non am I understand correctly that disabling of legacy shrinking is not turned on by default in latest versions?

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

No branches or pull requests

8 participants