Skip to content
Permalink
Browse files

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: #24748
Refs: #24486
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information...
BridgeAR committed Nov 30, 2018
1 parent 798504a commit e0e15da6ca30ed4d6ef25916e6c4ef4519b1bde0
Showing with 3 additions and 3 deletions.
  1. +3 −3 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 = {

0 comments on commit e0e15da

Please sign in to comment.
You can’t perform that action at this time.