File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments