Skip to content

Commit

Permalink
bugfix: Print stack trace for assertEquals
Browse files Browse the repository at this point in the history
Not sure why not show the stack trace and it's rather unexpected

Fixes #782
  • Loading branch information
tgodzik committed Nov 28, 2024
1 parent a602b01 commit 8181ceb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion munit/shared/src/main/scala/munit/Assertions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ trait Assertions extends MacroCompat.CompileErrorMacro {
obtained,
expected,
loc,
isStackTracesEnabled = false
isStackTracesEnabled = true
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ object FullStackTraceFrameworkSuite
extends BaseStackTraceFrameworkSuite(
Array("-F"),
"""|at munit.Assertions:failComparison
| at munit.Assertions:failComparison$
| at munit.FunSuite:failComparison
| at munit.Assertions$$anon$1:handle
|==> failure munit.StackTraceFrameworkSuite.fail - tests/shared/src/main/scala/munit/StackTraceFrameworkSuite.scala:5
|4: test("fail") {
|5: assertNoDiff("a", "b")
Expand All @@ -44,7 +47,9 @@ object FullStackTraceFrameworkSuite
object SmallStackTraceFrameworkSuite
extends BaseStackTraceFrameworkSuite(
Array(),
"""|at munit.Assertions:failComparison
"""|at munit.FunSuite:assertNoDiff
| at munit.StackTraceFrameworkSuite:$anonfun$new$1
| at scala.runtime.java8.JFunction0$mcV$sp:apply
|==> failure munit.StackTraceFrameworkSuite.fail - tests/shared/src/main/scala/munit/StackTraceFrameworkSuite.scala:5
|4: test("fail") {
|5: assertNoDiff("a", "b")
Expand Down

0 comments on commit 8181ceb

Please sign in to comment.