Closed
Conversation
Collaborator
Author
|
BTW: This PR builds on top of #172 - which renamed the QCheck2 unit test file. |
This was referenced Sep 9, 2021
Closed
This was referenced Apr 2, 2022
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When writing the shrinking logs I noticed that the
Test.check_exnwas wrong:It said it would throw a
Test_errorexception on both failures and errors.I figured it would be nice to add a couple of unit-tests to ensure this for
QCheck2.This PR does both of these.
As a bonus, it adds a few unit tests for
QCheck, including some for theint*shrinkersto bring the unit test status closer to
QCheck2.After having realized that the shrinker's output depend on whether the tested property holds or not,
I split them up into a successful shrink trace and a failure shrink trace,
I then noticed that our current
int*shrinkers produce the same number twice at the end, e.g.,for
Shrink.int 100tested on, e.g.,(fun i -> i<100)it tries:[50; 75; 88; 94; 97; 99; 99]🤔This is confirmed by
shrink_algo_logs/int_smaller_209609_qcheck.expectedwhich tests 209608 twice at the end.I'll investigate. I think that could make for another potential
Shrink.intimprovement on top of PR #173.