build: fix line length off by one error

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: https://github.com/nodejs/node/pull/24748
Refs: https://github.com/nodejs/node/pull/24486
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
Ruben Bridgewater 2018-11-30 12:44:30 +01:00 committed by Daniel Bevenius
parent 32fed93aee
commit 3099647902

View File

@ -423,7 +423,7 @@ class CompactProgressIndicator(ProgressIndicator):
}
status = self.Truncate(status, 78)
self.last_status_length = len(status)
print(status, end=' ')
print(status, end='')
sys.stdout.flush()
@ -438,7 +438,7 @@ class ColorProgressIndicator(CompactProgressIndicator):
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):
@ -454,7 +454,7 @@ class MonochromeProgressIndicator(CompactProgressIndicator):
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 = {