-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbc97b8
commit eaeb096
Showing
11 changed files
with
145 additions
and
51 deletions.
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
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
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package cats | ||
package tests | ||
|
||
import cats.kernel.laws.GroupLaws | ||
|
||
class GroupTests extends CatsSuite { | ||
test("combine minValue") { | ||
Group[Int].combineN(1, Int.MinValue) should ===(Int.MinValue) | ||
} | ||
|
||
test("combine negative") { | ||
Group[Int].combineN(1, -1) should ===(-1) | ||
Group[Int].combineN(1, -10) should ===(-10) | ||
} | ||
|
||
test("companion object syntax") { | ||
Group[Int].inverse(1) should ===(-1) | ||
Group[Int].remove(1, 2) should ===(-1) | ||
} | ||
|
||
checkAll("Int", GroupLaws[Int].group) | ||
checkAll("Double", GroupLaws[Double].group) | ||
checkAll("Float", GroupLaws[Float].group) | ||
checkAll("Long", GroupLaws[Long].group) | ||
} |
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 |
---|---|---|
@@ -1,22 +1,29 @@ | ||
package cats | ||
package tests | ||
|
||
import org.scalatest._ | ||
|
||
import cats.functor._ | ||
|
||
class MonoidTests extends FunSuite { | ||
class MonoidTests extends CatsSuite { | ||
{ | ||
import cats.implicits._ | ||
Invariant[Monoid] | ||
Cartesian[Monoid] | ||
InvariantMonoidal[Monoid] | ||
} | ||
|
||
{ | ||
test("companion object syntax") { | ||
Monoid.empty[Int] should ===(0) | ||
Monoid.isEmpty(1) should ===(false) | ||
Monoid.isEmpty(0) should ===(true) | ||
} | ||
} | ||
|
||
object MonoidTests { | ||
def summonInstance(): Unit = { | ||
import cats.instances.monoid._ | ||
Invariant[Monoid] | ||
Cartesian[Monoid] | ||
InvariantMonoidal[Monoid] | ||
() | ||
} | ||
|
||
} |
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
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 |
---|---|---|
@@ -1,20 +1,31 @@ | ||
package cats | ||
package tests | ||
|
||
import org.scalatest._ | ||
|
||
import cats.functor._ | ||
|
||
class PartialOrderTests extends FunSuite { | ||
class PartialOrderTests extends CatsSuite { | ||
{ | ||
import cats.implicits._ | ||
Invariant[PartialOrder] | ||
Contravariant[PartialOrder] | ||
} | ||
|
||
{ | ||
test("companion object syntax") { | ||
PartialOrder.partialCompare(1, 2) should ===(catsKernelStdOrderForInt.partialCompare(1, 2)) | ||
PartialOrder.tryCompare(1, 2) should ===(catsKernelStdOrderForInt.tryCompare(1, 2)) | ||
PartialOrder.pmin(1, 2) should ===(catsKernelStdOrderForInt.pmin(1, 2)) | ||
PartialOrder.pmax(1, 2) should ===(catsKernelStdOrderForInt.pmax(1, 2)) | ||
PartialOrder.lteqv(1, 2) should ===(catsKernelStdOrderForInt.lteqv(1, 2)) | ||
PartialOrder.lt(1, 2) should ===(catsKernelStdOrderForInt.lt(1, 2)) | ||
PartialOrder.gteqv(1, 2) should ===(catsKernelStdOrderForInt.gteqv(1, 2)) | ||
PartialOrder.gt(1, 2) should ===(catsKernelStdOrderForInt.gt(1, 2)) | ||
} | ||
} | ||
|
||
object PartialOrderTests { | ||
def summonInstance(): Unit = { | ||
import cats.instances.partialOrder._ | ||
Invariant[PartialOrder] | ||
Contravariant[PartialOrder] | ||
() | ||
} | ||
} |