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

Property test rework #1135

Merged
merged 18 commits into from Dec 27, 2019
Merged

Property test rework #1135

merged 18 commits into from Dec 27, 2019

Conversation

@sksamuel
Copy link
Member

sksamuel commented Dec 27, 2019

This isn't complete but what is there works
But if you think I'm going along the correct lines, then I'd rather merge sooner than later so other people can help out the migration effort. We can always rename / refactor again later.
What is left is completing the rest of the arbitrariness so we have what was there before in gens.
This PR also migrates all our build files to gradle kotlin files.

closes #780
closes #717
closes #967
closes #969
closes #815
closes #1037

@sksamuel sksamuel requested review from EarthCitizen and Kerooker Dec 27, 2019
@sksamuel

This comment has been minimized.

Copy link
Member Author

sksamuel commented Dec 27, 2019

See discussion in #1121

@Kerooker

This comment has been minimized.

Copy link
Member

Kerooker commented Dec 27, 2019

Maybe close #472

* The edge cases are: [Int.MAX_VALUE]
*/
fun Arbitrary.Companion.positiveIntegers(iterations: Int): Arbitrary<Int> =
int(iterations).withEdgeCases(Int.MAX_VALUE).filter { it > 0 }

This comment has been minimized.

Copy link
@Kerooker

Kerooker Dec 27, 2019

Member

Using filter here might take too long to generate compatible values, and tests that use this will take longer to run

This comment has been minimized.

Copy link
@sksamuel

sksamuel Dec 27, 2019

Author Member

Same impl that we had before.

This comment has been minimized.

Copy link
@sksamuel

sksamuel Dec 27, 2019

Author Member

Plus it'll only through away 50% of values. If it was trying to find 1% of values it would be horrible.

* Returns an [Arbitrary] where each value is a randomly chosen natural integer.
* The edge cases are: [Int.MAX_VALUE]
*/
fun Arbitrary.Companion.nats(iterations: Int): Arbitrary<Int> = int(iterations).filter { it >= 0 }

This comment has been minimized.

Copy link
@Kerooker

Kerooker Dec 27, 2019

Member

Same as above

sksamuel added 6 commits Dec 27, 2019
@sksamuel sksamuel merged commit cd91426 into master Dec 27, 2019
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@sksamuel sksamuel deleted the wip/props branch Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.