Skip to content

Commit

Permalink
Syntax tests in cats.arrow
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundnoble committed Jul 2, 2017
1 parent 1daa0e7 commit e2da87f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/src/test/scala/cats/tests/ComposeTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,9 @@ class ComposeTest extends CatsSuite {

val functionAlgebra = functionCompose.algebra[Int]
checkAll("Compose[Function1].algebra[Int]", GroupLaws[Endo[Int]].semigroup(functionAlgebra))

test("syntax") {
(((_: Int) + 1) <<< ((_: Int) / 2))(2) should be(2)
(((_: Int) + 1) >>> ((_: Int) / 2))(5) should be(3)
}
}
9 changes: 9 additions & 0 deletions tests/src/test/scala/cats/tests/SplitTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package cats
package tests

class SplitTest extends CatsSuite {
test("syntax") {
val f = (((_: Int) + 1) split ((_: Int) / 2))
f((1, 2)) should be((2, 1))
}
}

0 comments on commit e2da87f

Please sign in to comment.