diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-23 17:39:52 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-23 17:39:52 -0400 |
commit | a0a014b334301323f92397b18221950ae479d1c1 (patch) | |
tree | 1d25e5f94650bc3314c308527ca6448cb9d31765 /test/regress.py | |
parent | 72a5e972c7467a113834221ccd18c38fe60a720b (diff) | |
download | fork-ledger-a0a014b334301323f92397b18221950ae479d1c1.tar.gz fork-ledger-a0a014b334301323f92397b18221950ae479d1c1.tar.bz2 fork-ledger-a0a014b334301323f92397b18221950ae479d1c1.zip |
Allow $FILE in regression test error output match
Diffstat (limited to 'test/regress.py')
-rwxr-xr-x | test/regress.py | 13 |
1 files changed, 5 insertions, 8 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 |