Skip to content

Commit adac9ca

Browse files
committed
Fix format_message crash when message is not a string
1 parent 7b20c28 commit adac9ca

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
@@ -613,7 +613,12 @@ defmodule ExUnit.Formatter do
613613
end
614614

615615
defp format_message(value, formatter) do
616-
value = pad_multiline(value, 5)
616+
value =
617+
case value do
618+
binary when is_binary(binary) -> binary
619+
other -> inspect(other)
620+
end
621+
|> pad_multiline(5)
617622

618623
if String.contains?(value, IO.ANSI.reset()) do
619624
value

0 commit comments

Comments
 (0)