Skip to content

Commit

Permalink
Revert "Simplify further: \r is sufficient to clear whole line, no ne…
Browse files Browse the repository at this point in the history
…ed for additional escape sequence"

This reverts commit b152a0b.

In fact, unless in Emacs, \r is not sufficient to clear the whole line.
  • Loading branch information
Bodigrim committed Jul 19, 2024
1 parent b3e1d29 commit d2a0562
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/Test/Tasty/Ingredients/ConsoleReporter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,10 @@ buildTestOutput opts tree =
("", pct) -> printf "%.0f%% " pct
(txt, 0.0) -> printf "%s" txt
(txt, pct) -> printf "%s: %.0f%% " txt pct
putChar '\r'
-- A new progress message may be shorter than the previous one
-- so we must clean whole line and print anew.
putChar '\r'
clearLine
putStr testNamePadded
infoOk msg
hFlush stdout
Expand All @@ -190,6 +191,7 @@ buildTestOutput opts tree =

when getAnsiTricks $ do
putChar '\r'
clearLine
putStr testNamePadded

printFn (resultShortDescription result)
Expand Down

0 comments on commit d2a0562

Please sign in to comment.