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

Fix law-checking to print better error messages #514

Closed
non opened this issue Sep 2, 2015 · 2 comments
Closed

Fix law-checking to print better error messages #514

non opened this issue Sep 2, 2015 · 2 comments

Comments

@non
Copy link
Contributor

non commented Sep 2, 2015

I'm not sure how to do this, but in Cats right now when a property fails you see the generated input (good) but then just a gigantic stack trace.

When we set this up in Algebra, the ?== operator was designed to use ScalaCheck's labels so that you could "see" the values being compared when there was a failure. I'm not sure why that isn't working here.

Anyway, this isn't critically-important, but since many folks will be discovering law-checking through Cats, it would be good to have a better experience here.

@ceedubs
Copy link
Contributor

ceedubs commented Sep 6, 2015

I made an override to our List instance's map method to always return Nil, and I see a helpful label of the two values being compared just after the generated input:

[info] - List[Int] with Option.traverse.traverse identity *** FAILED *** (13 milliseconds)
[info]   GeneratorDrivenPropertyCheckFailedException was thrown during property evaluation.
[info]    (Discipline.scala:14)
[info]     Falsified after 4 successful property evaluations.
[info]     Location: (Discipline.scala:14)
[info]     Occurred when passed generated values (
[info]       arg0 = List(-1847342633, -1931831606, 558565564, 0),
[info]       arg1 = <function1>
[info]     )
[info]     Label of failing property:
[info]       (List(-1135542905, -1135542905, -1135542905, -1135542905) ?== List()) failed

Note the Label of failing property: section at the end.

@non was this not showing up for you somewhere?

@ceedubs
Copy link
Contributor

ceedubs commented Mar 24, 2018

I think that this was improved by #2052. I'm going to go ahead and close this out. @non feel free to reopen if you think that there are still improvements that could be made here.

@ceedubs ceedubs closed this as completed Mar 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants