Skip to content

Commit

Permalink
Add tests for toNested etc
Browse files Browse the repository at this point in the history
  • Loading branch information
conniec committed Oct 20, 2016
1 parent 726b4fe commit 82a5c98
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/src/test/scala/cats/tests/EitherTTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,24 @@ class EitherTTests extends CatsSuite {
}
}

test("toNested") {
forAll { (eithert: EitherT[List, String, Int]) =>
eithert.toNested.map(_.toEither) should === (eithert.value)
}
}

test("toNestedValidated") {
forAll { (eithert: EitherT[List, String, Int]) =>
eithert.toNestedValidated.map(_.toValidated) should === (eithert.value)
}
}

test("toNestedValidatedNel") {
forAll { (eithert: EitherT[List, String, Int]) =>
eithert.toNestedValidatedNel.map(_.toValidatedNel) should === (eithert.value)
}
}

test("withValidated") {
forAll { (eithert: EitherT[List, String, Int], f: String => Char, g: Int => Double) =>
eithert.withValidated(_.bimap(f, g)) should === (eithert.bimap(f, g))
Expand Down

0 comments on commit 82a5c98

Please sign in to comment.