Skip to content

Commit

Permalink
Update tests/shared/src/test/scala/munit/FailExceptionSuite.scala
Browse files Browse the repository at this point in the history
Co-authored-by: Tomasz Godzik <tgodzik@users.noreply.github.com>
  • Loading branch information
mzuehlke and tgodzik committed Apr 16, 2024
1 parent 3c59ad1 commit 15f8d41
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/shared/src/test/scala/munit/FailExceptionSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,21 @@ class FailExceptionSuite extends BaseSuite {
assert(clue(e).isInstanceOf[Serializable])
}

test("assertion-error no exception") {
test("assertion-error-no-exception") {
try {
intercept[AssertionError] {
println("throwing no exception!")
}
throw new Exception("should not reach here")
} catch {
case e: FailException =>
assert(
e.getMessage.contains(
"expected exception of type 'java.lang.AssertionError' but body evaluated successfully"
)
)
case _: Throwable =>
fail("No FailException was thrown")
}
}
}

0 comments on commit 15f8d41

Please sign in to comment.