Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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.
  • Loading branch information
BridgeAR committed Nov 30, 2018
commit 1753aa918824401785ffa55ad328d2690ee25107
6 changes: 3 additions & 3 deletions tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand All @@ -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):
Expand All @@ -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 = {
Expand Down