diff --git a/tests/shared/src/test/scala-2/cats/tests/FunctionKLiftSuite.scala b/tests/shared/src/test/scala-2/cats/tests/FunctionKLiftSuite.scala index 7dd041d2bc..04257a3474 100644 --- a/tests/shared/src/test/scala-2/cats/tests/FunctionKLiftSuite.scala +++ b/tests/shared/src/test/scala-2/cats/tests/FunctionKLiftSuite.scala @@ -72,14 +72,6 @@ class FunctionKLiftSuite extends CatsSuite { } } - test("lift a function directly") { - def headOption[A](list: List[A]): Option[A] = list.headOption - val fHeadOption = FunctionK.liftFunction[List, Option](headOption) - forAll { (a: List[Int]) => - assert(fHeadOption(a) === a.headOption) - } - } - { // lifting concrete types should fail to compile def sample[A](option: Option[A]): List[A] = option.toList assert(compileErrors("FunctionK.lift(sample[String])").nonEmpty) diff --git a/tests/shared/src/test/scala-3/cats/tests/FunctionKLiftSuite.scala b/tests/shared/src/test/scala-3/cats/tests/FunctionKLiftSuite.scala index 9345706234..da70f8fc87 100644 --- a/tests/shared/src/test/scala-3/cats/tests/FunctionKLiftSuite.scala +++ b/tests/shared/src/test/scala-3/cats/tests/FunctionKLiftSuite.scala @@ -34,12 +34,4 @@ class FunctionKLiftSuite extends CatsSuite { assert(fHeadOption(a) === a.headOption) } } - - test("lift a function directly using Scala 2 compatible syntax") { - def headOption[A](list: List[A]): Option[A] = list.headOption - val fHeadOption = FunctionK.liftFunction[List, Option](headOption) - forAll { (a: List[Int]) => - assert(fHeadOption(a) === a.headOption) - } - } } diff --git a/tests/shared/src/test/scala/cats/tests/FunctionKLiftCrossBuildSuite.scala b/tests/shared/src/test/scala/cats/tests/FunctionKLiftCrossBuildSuite.scala new file mode 100644 index 0000000000..5edb678a96 --- /dev/null +++ b/tests/shared/src/test/scala/cats/tests/FunctionKLiftCrossBuildSuite.scala @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2015 Typelevel + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +package cats.tests + +import cats.arrow.FunctionK +import cats.syntax.all._ +import org.scalacheck.Prop._ + +class FunctionKLiftCrossBuildSuite extends CatsSuite { + test("lift a function directly") { + def headOption[A](list: List[A]): Option[A] = list.headOption + val fHeadOption = FunctionK.liftFunction[List, Option](headOption) + forAll { (a: List[Int]) => + assert(fHeadOption(a) === a.headOption) + } + } +}