From 82a5c989e393ddac700a8a1cfbf6a3e89471abd2 Mon Sep 17 00:00:00 2001 From: Connie Chen Date: Thu, 20 Oct 2016 14:18:56 -0700 Subject: [PATCH] Add tests for toNested etc --- .../test/scala/cats/tests/EitherTTests.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/src/test/scala/cats/tests/EitherTTests.scala b/tests/src/test/scala/cats/tests/EitherTTests.scala index 9f344cc2e5d..d4df6a55106 100644 --- a/tests/src/test/scala/cats/tests/EitherTTests.scala +++ b/tests/src/test/scala/cats/tests/EitherTTests.scala @@ -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))