From a0a014b334301323f92397b18221950ae479d1c1 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 23 Feb 2009 17:39:52 -0400 Subject: Allow $FILE in regression test error output match --- test/regress.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'test/regress.py') 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 -- cgit v1.2.3