From e0e15da6ca30ed4d6ef25916e6c4ef4519b1bde0 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Fri, 30 Nov 2018 12:44:30 +0100 Subject: [PATCH] build: fix line length off by one error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Michaƫl Zasso --- tools/test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test.py b/tools/test.py index 640206f95cb420..2366d490e248eb 100755 --- a/tools/test.py +++ b/tools/test.py @@ -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() @@ -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): @@ -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 = {