Skip to content

Commit 53dffc9

Browse files
committed
FIXUP
1 parent 2310bed commit 53dffc9

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

lib/ex_unit/lib/ex_unit/cli_formatter.ex

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -447,19 +447,20 @@ defmodule ExUnit.CLIFormatter do
447447
end
448448

449449
defp format_passed_breakdown(test_counter, failure_type_counter) do
450-
types = test_counter |> Map.keys() |> Enum.sort()
451-
452-
if length(types) <= 1 do
450+
# If there are no different test types, we just print "Passed: N/N"
451+
# without the type.
452+
if map_size(test_counter) in 0..1 do
453453
""
454454
else
455-
types
456-
|> Enum.map(fn type ->
457-
total = Map.get(test_counter, type, 0)
455+
test_counter
456+
|> Map.keys()
457+
|> Enum.sort()
458+
|> Enum.map_join(", ", fn type ->
459+
total = Map.fetch!(test_counter, type)
458460
failed = Map.get(failure_type_counter, type, 0)
459461
passed = total - failed
460462
"#{passed}/#{total} #{pluralize_type(total, type)}"
461463
end)
462-
|> Enum.join(", ")
463464
end
464465
end
465466

0 commit comments

Comments
 (0)