Skip to content

Commit c45d9ab

Browse files
committed
Do not discard blamed stacktrace from exception in exit in ExUnit formatter
1 parent 9409605 commit c45d9ab

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/ex_unit/lib/ex_unit/formatter.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ defmodule ExUnit.Formatter do
231231
{header, wrapped_reason, wrapped_stack} ->
232232
struct = Exception.normalize(:error, wrapped_reason, wrapped_stack)
233233

234-
{formatted_reason, _} =
234+
{formatted_reason, wrapped_stack} =
235235
format_exception(test, struct, wrapped_stack, width, formatter, @counter_padding)
236236

237237
formatted_stack = format_stacktrace(wrapped_stack, test.module, test.name, formatter)

lib/ex_unit/test/ex_unit/formatter_test.exs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ defmodule ExUnit.FormatterTest do
153153
end
154154

155155
failure = [{{:EXIT, self()}, {error, stack}, []}]
156+
format = trim_multiline_whitespace(format_test_failure(test(), failure, 1, 80, &formatter/2))
156157

157-
assert trim_multiline_whitespace(format_test_failure(test(), failure, 1, 80, &formatter/2)) =~
158+
assert format =~
158159
"""
159160
1) world (Hello)
160161
test/ex_unit/formatter_test.exs:1
@@ -174,6 +175,8 @@ defmodule ExUnit.FormatterTest do
174175
175176
def fetch(%module{} = container, key)
176177
"""
178+
179+
assert format =~ ~r"lib/access.ex:\d+: Access.fetch/2"
177180
end
178181

179182
test "formats test EXITs with assertion errors" do

0 commit comments

Comments
 (0)