lib/minitest/compress.rb in minitest-5.21.1 vs lib/minitest/compress.rb in minitest-5.21.2

- old
+ new

@@ -62,20 +62,33 @@ break unless min ary = min.flat_map { |(n, lines)| if n > 1 then + [[n, compress(lines)]] # [o1 [2 s1] [2 s2]] + else + lines + end + } + end + + format = ->(lines) { + lines.flat_map { |line| + case line + when Array then + n, lines = line + lines = format[lines] [ " +->> #{n} cycles of #{lines.size} lines:", *lines.map { |s| " | #{s}" }, " +-<<", ] else - lines + line end } - end + } - ary + format[ary] end end end