Skip to content

Commit

Permalink
Merge pull request #663 from ceedubs/xort-to-tests
Browse files Browse the repository at this point in the history
Add a couple XorT to/toEither/toOption tests
  • Loading branch information
non committed Nov 16, 2015
2 parents f4db3c4 + 3f49f9c commit 1ca7970
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/src/test/scala/cats/tests/XorTTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,16 @@ class XorTTests extends CatsSuite {
x.merge should === (x.value.merge)
}
}

test("to consistent with toOption") {
forAll { (x: XorT[List, String, Int]) =>
x.to[Option] should === (x.toOption.value)
}
}

test("toEither consistent with toOption") {
forAll { (x: XorT[List, String, Int]) =>
x.toEither.map(_.right.toOption) should === (x.toOption.value)
}
}
}

0 comments on commit 1ca7970

Please sign in to comment.