Skip to content

Commit 5ea5313

Browse files
committed
Added Foldable and CoflatMap tests explicit implicits in the local scope so they don't pick up those from Traverse and Comonad
1 parent 743b75f commit 5ea5313

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

tests/src/test/scala/cats/tests/CoproductTests.scala

+10-4
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ class CoproductTests extends CatsSuite {
1414
checkAll("Coproduct[Option, Option, ?]", TraverseTests[Coproduct[Option, Option, ?]].traverse[Int, Int, Int, Int, Option, Option])
1515
checkAll("Traverse[Coproduct[Option, Option, ?]]", SerializableTests.serializable(Traverse[Coproduct[Option, Option, ?]]))
1616

17-
checkAll("Coproduct[Option, Option, ?]", FoldableTests[Coproduct[Option, Option, ?]].foldable[Int, Int])
18-
checkAll("Foldable[Coproduct[Option, Option, ?]]", SerializableTests.serializable(Foldable[Coproduct[Option, Option, ?]]))
17+
{
18+
implicit val foldable = Coproduct.coproductFoldable[Option, Option]
19+
checkAll("Coproduct[Option, Option, ?]", FoldableTests[Coproduct[Option, Option, ?]].foldable[Int, Int])
20+
checkAll("Foldable[Coproduct[Option, Option, ?]]", SerializableTests.serializable(Foldable[Coproduct[Option, Option, ?]]))
21+
}
1922

2023
checkAll("Coproduct[Eval, Eval, ?]", ComonadTests[Coproduct[Eval, Eval, ?]].comonad[Int, Int, Int])
2124
checkAll("Comonad[Coproduct[Eval, Eval, ?]]", SerializableTests.serializable(Comonad[Coproduct[Eval, Eval, ?]]))
2225

23-
checkAll("Coproduct[Eval, Eval, ?]", CoflatMapTests[Coproduct[Eval, Eval, ?]].coflatMap[Int, Int, Int])
24-
checkAll("CoflatMap[Coproduct[Eval, Eval, ?]]", SerializableTests.serializable(CoflatMap[Coproduct[Eval, Eval, ?]]))
26+
{
27+
implicit val coflatMap = Coproduct.coproductCoflatMap[Eval, Eval]
28+
checkAll("Coproduct[Eval, Eval, ?]", CoflatMapTests[Coproduct[Eval, Eval, ?]].coflatMap[Int, Int, Int])
29+
checkAll("CoflatMap[Coproduct[Eval, Eval, ?]]", SerializableTests.serializable(CoflatMap[Coproduct[Eval, Eval, ?]]))
30+
}
2531

2632
checkAll("Coproduct[Option, Option, Int]", OrderLaws[Coproduct[Option, Option, Int]].eqv)
2733
checkAll("Eq[Coproduct[Option, Option, Int]]", SerializableTests.serializable(Eq[Coproduct[Option, Option, Int]]))

0 commit comments

Comments
 (0)