Skip to content

Commit d98a77e

Browse files
committed
Fix format_message crash when message is not a string
1 parent 2cfd329 commit d98a77e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/ex_unit/lib/ex_unit/formatter.ex

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,12 @@ defmodule ExUnit.Formatter do
622622
end
623623

624624
defp format_message(value, formatter) do
625-
value = pad_multiline(value, 5)
625+
value =
626+
case value do
627+
binary when is_binary(binary) -> binary
628+
other -> inspect(other)
629+
end
630+
|> pad_multiline(5)
626631

627632
if String.contains?(value, IO.ANSI.reset()) do
628633
value

0 commit comments

Comments
 (0)