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

Print shrunk values first, then the _ORIGINAL values #635

Merged
merged 1 commit into from
May 7, 2020

Conversation

jonaskoelker
Copy link
Contributor

This makes forAll { (x: Int, y: Int) => false } fail as follows:

[info] > ARG_0: 0
[info] > ARG_1: 0
[info] > ARG_0_ORIGINAL: -1737265162
[info] > ARG_1_ORIGINAL: -1

instead of

[info] > ARG_0: 0
[info] > ARG_0_ORIGINAL: -1737265162
[info] > ARG_1: 0
[info] > ARG_1_ORIGINAL: -1

I prefer the former error message: when a property fails, I typically
want to see a set of inputs that made it fail. The new layout shows
me first the shrunk set of inputs (with nothing else interleaved),
then the original set of inputs (with nothing else interleaved).

This makes `forAll { (x: Int, y: Int) => false }` fail as follows:

[info] > ARG_0: 0
[info] > ARG_1: 0
[info] > ARG_0_ORIGINAL: -1737265162
[info] > ARG_1_ORIGINAL: -1

instead of

[info] > ARG_0: 0
[info] > ARG_0_ORIGINAL: -1737265162
[info] > ARG_1: 0
[info] > ARG_1_ORIGINAL: -1

I prefer the former error message: when a property fails, I typically
want to see a set of inputs that made it fail.  The new layout shows
me first the shrunk set of inputs (with nothing else interleaved),
then the original set of inputs (with nothing else interleaved).
@non
Copy link
Contributor

non commented May 6, 2020

Looks good to me. What do you think @ashawley?

The only downside I can see would be if some tools out there are trying to parse ScalaCheck's output and will get confused. I can't think of anything that does this offhand -- is there something I'm missing?

@ashawley
Copy link
Contributor

ashawley commented May 7, 2020

This makes sense to me.

I doubt there are any tools out there parsing ScalaCheck's failure output, besides the pattern recognition part of a user's brains that is expecting the current format. ;-)

I suppose we'd just need to update documentation and the ScalaCheck book. The chance of someone noticing the difference are probably small, though.

@non non merged commit 5071d6d into typelevel:master May 7, 2020
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.

3 participants