mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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:
1 parent
5844a0653d
commit
84353ac4c6
1 file changed
+3
-3
+3
-3
@@ -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 = {
|
||||
|
||||
Reference in new issue
Block a user