summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-02-23 17:39:52 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-02-23 17:39:52 -0400
commita0a014b334301323f92397b18221950ae479d1c1 (patch)
tree1d25e5f94650bc3314c308527ca6448cb9d31765 /test
parent72a5e972c7467a113834221ccd18c38fe60a720b (diff)
downloadfork-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')
-rwxr-xr-xtest/regress.py13
-rw-r--r--test/regress/2E3496BD.test4
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