From e2da87f51cf5999561d0299aed9774f6fc36aa61 Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Sun, 2 Jul 2017 03:40:37 -0400 Subject: [PATCH] Syntax tests in cats.arrow --- tests/src/test/scala/cats/tests/ComposeTest.scala | 5 +++++ tests/src/test/scala/cats/tests/SplitTest.scala | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/src/test/scala/cats/tests/SplitTest.scala diff --git a/tests/src/test/scala/cats/tests/ComposeTest.scala b/tests/src/test/scala/cats/tests/ComposeTest.scala index 55c3df6bc48..d848901f2c5 100644 --- a/tests/src/test/scala/cats/tests/ComposeTest.scala +++ b/tests/src/test/scala/cats/tests/ComposeTest.scala @@ -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) + } } diff --git a/tests/src/test/scala/cats/tests/SplitTest.scala b/tests/src/test/scala/cats/tests/SplitTest.scala new file mode 100644 index 00000000000..3cc5af0d838 --- /dev/null +++ b/tests/src/test/scala/cats/tests/SplitTest.scala @@ -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)) + } +}