Skip to content

Commit

Permalink
Add a test for FEitherSyntax.mapOrKeepIn
Browse files Browse the repository at this point in the history
  • Loading branch information
danicheg committed Jun 15, 2024
1 parent 8ea54a9 commit 3797bf1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions shared/src/test/scala/mouse/FEitherSyntaxTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ class FEitherSyntaxTest extends MouseSuite {
assertEquals(leftValue.mapIn(_ * 2), leftValue)
}

test("FEitherSyntax.mapOrKeepIn") {
assertEquals(rightValue.mapOrKeepIn { case 42 => 84 }, List(84.asRight[String]))
assertEquals(rightValue.mapOrKeepIn { case 84 => 42 }, rightValue)
assertEquals(leftValue.mapOrKeepIn { case 42 => 84 }, leftValue)
}

test("FEitherSyntax.asIn") {
assertEquals(rightValue.asIn(2), List(2.asRight[String]))
assertEquals(leftValue.asIn(2), leftValue)
Expand Down

0 comments on commit 3797bf1

Please sign in to comment.