Skip to content

Commit 84446a7

Browse files
committed
Strip trailing whitespace for diff-based regressions
1 parent f7abfa5 commit 84446a7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

TestCases/TestCase.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,9 @@ def run_filediff(self, with_tsan=False, with_asan=False, with_tapetests=False):
386386

387387
# If file tolerance is set to 0, make regular diff
388388
if self.tol_file_percent == 0.0:
389+
# Strip trailing whitespace but keep newline for difflib
390+
fromlines = [line.rstrip() + '\n' for line in fromlines]
391+
tolines = [line.rstrip() + '\n' for line in tolines]
389392
diff = list(difflib.unified_diff(fromlines, tolines, fromfile, tofile, fromdate, todate))
390393

391394
# Else test word by word with given tolerance

0 commit comments

Comments
 (0)