From 30996479027464d252236b4e00fc62a5421a8296 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 640206f95cb..2366d490e24 100755 --- a/tools/test.py +++ b/tools/test.py @@ -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 = {