Skip to content

Commit

Permalink
Make FailException extend AssertionError, fixes #215
Browse files Browse the repository at this point in the history
  • Loading branch information
Olafur Pall Geirsson committed Oct 17, 2020
1 parent eb4574c commit 69068a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion munit/shared/src/main/scala/munit/FailException.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class FailException(
val cause: Throwable,
val isStackTracesEnabled: Boolean,
val location: Location
) extends Exception(message, cause)
) extends AssertionError(message, cause)
with Serializable {
def this(message: String, location: Location) =
this(message, null, true, location)
Expand Down
7 changes: 7 additions & 0 deletions tests/shared/src/test/scala/munit/FailExceptionSuite.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package munit

class FailExceptionSuite extends BaseSuite {
test("assertion-error") {
val error: AssertionError = new FailException("", Location.generate)
}
}

0 comments on commit 69068a2

Please sign in to comment.