Skip to content

Commit

Permalink
Add tests related to the change
Browse files Browse the repository at this point in the history
  • Loading branch information
mox692 committed Aug 12, 2023
1 parent 5c06b8a commit 288587e
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/shared/src/test/scala/cats/tests/SyntaxSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,8 @@ object SyntaxSuite {
val f = mock[(A, B, C) => Z]
val ff = mock[F[(A, B, C) => Z]]

fa.productR(fb)
fa.productL(fb)
fa *> fb
fb <* fc

Expand All @@ -394,6 +396,19 @@ object SyntaxSuite {

thabcde.imapN(f5)(g5)
(ha, hb, hc, hd, he).imapN(f5)(g5)

val tfab = mock[F[A => B]]
tfab.ap(fa)
tfab <*> fa

val tabcf = mock[F[(A, B) => C]]
tabcf.ap2(fa, fb)

val tabc = mock[(A, B) => C]
fa.map2(fb)(tabc)

val tEvalfb = mock[Eval[F[B]]]
fa.map2Eval(tEvalfb)(tabc)
}

def testBifoldable[F[_, _]: Bifoldable, A, B, C, D: Monoid]: Unit = {
Expand Down Expand Up @@ -688,4 +703,12 @@ object SyntaxSuite {

val result: Option[List[B]] = list.traverseCollect(f)
}

def testSemigroupal[F[_]: Semigroupal, A, B]: Unit = {
val fa = mock[F[A]]
val fb = mock[F[B]]

fa.product(fb)
fa |@| fb
}
}

0 comments on commit 288587e

Please sign in to comment.