Skip to content

Commit

Permalink
Simplify further: \r is sufficient to clear whole line, no need for a…
Browse files Browse the repository at this point in the history
…dditional escape sequence
  • Loading branch information
sergv authored and Bodigrim committed Dec 8, 2023
1 parent f124f67 commit b152a0b
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions core/Test/Tasty/Ingredients/ConsoleReporter.hs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,9 @@ 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.
clearLine
putChar '\r'
putStr testNamePadded
infoOk msg
hFlush stdout
Expand All @@ -191,7 +190,6 @@ buildTestOutput opts tree =

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

printFn (resultShortDescription result)
Expand Down

0 comments on commit b152a0b

Please sign in to comment.