Skip to content

Commit

Permalink
Merge pull request #856 from tgodzik/print-stack
Browse files Browse the repository at this point in the history
bugfix: Print stack trace for assertEquals
  • Loading branch information
tgodzik authored Nov 29, 2024
2 parents a602b01 + 8181ceb commit 94ffcf5
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 94ffcf5

Please sign in to comment.