Add labels to prop produced from IsEq#2052
Merged
kailuowang merged 1 commit intotypelevel:masterfrom Nov 29, 2017
Merged
Conversation
kailuowang
suggested changes
Nov 29, 2017
| 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 :| { |
Contributor
There was a problem hiding this comment.
This fails the scalastyle check with
no space after token if
Contributor
|
This is super cool! Thanks! |
10c26d5 to
b67f033
Compare
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
approved these changes
Nov 29, 2017
Contributor
ceedubs
left a comment
There was a problem hiding this comment.
Nice, I think that this is really useful.
kailuowang
approved these changes
Nov 29, 2017
Contributor
|
I guess that this resulted in a slight code coverage drop. It would probably be nice to have a test case for respecting |
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.
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).