From 04dfda2282bfb3686336600cfafd1d9653369445 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 22 Aug 2006 00:52:08 +0000 Subject: Made separate modules for the csv command, since the prior method was not fully correct. --- tests/confirm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'tests/confirm.py') diff --git a/tests/confirm.py b/tests/confirm.py index 0881001b..f4947224 100755 --- a/tests/confirm.py +++ b/tests/confirm.py @@ -17,8 +17,11 @@ errors = 0 report = sys.argv[1] for line in os.popen("./ledger -f utils/standard.dat -e 2004/4 %s reg %s" % (report, sys.argv[2])): - value = clean(line[55:67]) - total = clean(line[68:]) + match = re.match("\\s*([-$,0-9.]+)\\s+([-$,0-9.]+)", line[55:]) + if not match: + continue + value = clean(match.group(1)) + total = clean(match.group(2)) running_total += value diff = abs(running_total - total) -- cgit v1.2.3