File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
shared/src/test/scala/mouse Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,13 @@ class FEitherSyntaxTest extends MouseSuite {
104104 assertEquals(leftValue.leftFlatMapIn(_ => " " .asLeft[Int ]), List (" " .asLeft[Int ]))
105105 }
106106
107+ test(" FEitherSyntax.leftFlatMapOrKeepIn" ) {
108+ assertEquals(rightValue.leftFlatMapOrKeepIn { case " 42" => Left (" " ) }, rightValue)
109+ assertEquals(leftValue.leftFlatMapOrKeepIn { case " 4242" => Right (42 ) }, leftValue)
110+ assertEquals(leftValue.leftFlatMapOrKeepIn { case " 42" => Left (" " ) }, List (Left (" " )))
111+ assertEquals(leftValue.leftFlatMapOrKeepIn { case " 42" => Right (42 ) }, rightValue)
112+ }
113+
107114 test(" FEitherSyntax.leftFlatMapF" ) {
108115 assertEquals(rightValue.leftFlatMapF(_ => List (" " .asLeft[Int ])), rightValue)
109116 assertEquals(leftValue.leftFlatMapF(_ => List (" " .asLeft[Int ])), List (" " .asLeft[Int ]))
You can’t perform that action at this time.
0 commit comments