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 authored and Rod Vagg committed 2019-02-28 23:37:38 +11:00
1 parent 5844a0653d
commit 84353ac4c6
1 file changed
+3 -3
+3 -3
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 = {