diff options
-rwxr-xr-x | test/regress.py | 13 | ||||
-rw-r--r-- | test/regress/2E3496BD.test | 4 |
2 files changed, 7 insertions, 10 deletions
diff --git a/test/regress.py b/test/regress.py index 33efb06b..33140e6c 100755 --- a/test/regress.py +++ b/test/regress.py @@ -4,9 +4,9 @@ import sys import os import re import string -import difflib import tempfile +from difflib import unified_diff from subprocess import Popen, PIPE ledger = sys.argv[1] @@ -85,7 +85,7 @@ def test_regression(test_file): success = True printed = False index = 0 - for line in difflib.unified_diff(output, p.stdout.readlines()): + for line in unified_diff(output, p.stdout.readlines()): index += 1 if index < 3: continue @@ -100,12 +100,9 @@ def test_regression(test_file): printed = False index = 0 - lines = p.stderr.readlines() - if len(lines) > 0: - while re.match('While (parsing file|balancing entry from)', lines[0]): - lines = lines[1:] - error = error[1:] - for line in difflib.unified_diff(error, lines): + for line in unified_diff([re.sub('\$FILE', tempdata[1], line) + for line in error], + p.stderr.readlines()): index += 1 if index < 3: continue diff --git a/test/regress/2E3496BD.test b/test/regress/2E3496BD.test index 77a91a33..9ed0237b 100644 --- a/test/regress/2E3496BD.test +++ b/test/regress/2E3496BD.test @@ -7,8 +7,8 @@ D 1,000.00 USD Account2 -1000 EUR @ 1.5 USD >>>1 >>>2 -While parsing file "bug.dat", line 8: -While balancing entry from "bug.dat", lines 6-8: +While parsing file "$FILE", line 5: +While balancing entry from "$FILE", lines 3-5: > 2007-12-31 * Start of year / Opening balances. > Account1 1000 EUR @ 1.6 USD > Account2 -1000 EUR @ 1.5 USD |