-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Make kernel laws consistent with core laws #1922
Merged
kailuowang
merged 21 commits into
typelevel:master
from
LukaJCB:make-kernel-laws-consistent
Oct 6, 2017
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
20806ee
Make GroupLaws consistent with cats-core
269f0e9
Make OrderLaws consistent with core
ea453b3
Port tests
6bebba6
Update lawtesting docs
b9b2264
Remove unused machinery
28b0b41
Remove duplication of IsEq
b1fb806
Cleanup
e50bf06
Add Serializable to LawTests
b57dc31
Rename to -LawTests
b6de9dd
Fix BoundedSemilattice parents
f81d7b2
Add id
5073a95
Fix lawtesting docs
8435559
Restructure order law tests
e9ee232
Merge branch 'master' into make-kernel-laws-consistent
c6ce594
Move IsEq
8c60716
Merge branch 'master' into make-kernel-laws-consistent
8dbbb81
Convert HashLaws to new setup
ca30cd4
Readd function0 hash test
08e1bcd
Add mima exception
1ca0ecd
Rename to ascending order
668c4e1
Merge branch 'master' into make-kernel-laws-consistent
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package cats | |
package tests | ||
|
||
import cats.arrow.{Choice, CommutativeArrow} | ||
import cats.kernel.laws.HashLaws | ||
import cats.kernel.laws.discipline.{SerializableTests, _} | ||
import cats.laws.discipline._ | ||
import cats.laws.discipline.eq._ | ||
|
@@ -54,6 +55,13 @@ class FunctionTests extends CatsSuite { | |
checkAll("Function0[Grp]", GroupLawTests[Function0[Grp]].group) | ||
checkAll("Function0[CGrp]", CommutativeGroupTests[Function0[CGrp]].commutativeGroup) | ||
|
||
test("Function0[Hsh]") { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious, why not just test the full HashLaw? won't pass? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's not the same as universal hash and not the same as |
||
forAll { (x: Function0[Hsh], y: Function0[Hsh]) => | ||
HashLaws[Function0[Hsh]].hashCompatibility(x, y) | ||
} | ||
} | ||
|
||
|
||
// serialization tests for the various Function0-related instances | ||
checkAll("Eq[() => Eqed]", SerializableTests.serializable(Eq[() => Eqed])) | ||
checkAll("PartialOrder[() => POrd]", SerializableTests.serializable(PartialOrder[() => POrd])) | ||
|
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.
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.
just curious why not just test the hash law? won't pass?