Skip to content

Commit

Permalink
build: fix line length off by one error
Browse files Browse the repository at this point in the history
While running the test suite the progress bar shows former line
endings if the new line is shorter than the former line. The length
was calculated without the line ending. It is now an empty string
to prevent the off by one error instead of using extra whitespace.

PR-URL: nodejs#24748
Refs: nodejs#24486
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
BridgeAR authored and danbev committed Dec 3, 2018
1 parent 32fed93 commit 3099647
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def PrintProgress(self, name):
}
status = self.Truncate(status, 78)
self.last_status_length = len(status)
print(status, end=' ')
print(status, end='')
sys.stdout.flush()


Expand All @@ -438,7 +438,7 @@ def __init__(self, cases, flaky_tests_mode):
super(ColorProgressIndicator, self).__init__(cases, flaky_tests_mode, templates)

def ClearLine(self, last_line_length):
print("\033[1K\r", end=' ')
print("\033[1K\r", end='')


class MonochromeProgressIndicator(CompactProgressIndicator):
Expand All @@ -454,7 +454,7 @@ def __init__(self, cases, flaky_tests_mode):
super(MonochromeProgressIndicator, self).__init__(cases, flaky_tests_mode, templates)

def ClearLine(self, last_line_length):
print(("\r" + (" " * last_line_length) + "\r"), end=' ')
print(("\r" + (" " * last_line_length) + "\r"), end='')


PROGRESS_INDICATORS = {
Expand Down

0 comments on commit 3099647

Please sign in to comment.