Skip to content

Commit

Permalink
Add test.
Browse files Browse the repository at this point in the history
  • Loading branch information
takayahilton committed Nov 26, 2019
1 parent 6d04326 commit 9aa0b33
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/src/test/scala/cats/tests/TrySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ class TrySuite extends CatsSuite {
}
}

test("catchOnly catches only a specified type") {
a[NumberFormatException] should be thrownBy {
MonadError[Try, Throwable].catchOnly[UnsupportedOperationException]("str".toInt)
}
}

test("fromTry works") {
forAll { t: Try[Int] =>
(MonadError[Try, Throwable].fromTry(t)) should ===(t)
Expand Down

0 comments on commit 9aa0b33

Please sign in to comment.