-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add labels to prop produced from IsEq #2052
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
Conversation
| ev.eqv(isEq.lhs, isEq.rhs) | ||
| implicit def catsLawsIsEqToProp[A](isEq: IsEq[A])(implicit ev: Eq[A], pp: A => Pretty): Prop = | ||
| isEq match { case IsEq(x, y) => | ||
| if(ev.eqv(x, y)) Prop.proved else Prop.falsified :| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails the scalastyle check with
no space after token if
|
This is super cool! Thanks! |
10c26d5 to
b67f033
Compare
LukaJCB
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thanks!
Codecov Report
@@ Coverage Diff @@
## master #2052 +/- ##
==========================================
- Coverage 95% 94.95% -0.06%
==========================================
Files 311 311
Lines 5266 5269 +3
Branches 131 129 -2
==========================================
Hits 5003 5003
- Misses 263 266 +3
Continue to review full report at Codecov.
|
ceedubs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, I think that this is really useful.
|
I guess that this resulted in a slight code coverage drop. It would probably be nice to have a test case for respecting |
For failed
IsEqproduce labels with both values to simplify debugging.The implementation was borrowed from
org.scalacheck.Prop.?=with minimal changes. No changes to*Testtraits were made, so the default pretty-printer will be used in most cases, which shouldn't cause any problems. Changes to pass a pretty-printer through would be trivial, but would require a lot of small changes (and would be fragile unless we convertIsEqtoPropexplicitly everywhere, since we always have implicit pretty-printer forAny).