summaryrefslogtreecommitdiff
path: root/tests/confirm.py
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2006-08-22 00:52:08 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:33 -0400
commit04dfda2282bfb3686336600cfafd1d9653369445 (patch)
tree9ee02db5c2d33290dfa6060475973f7c378ce643 /tests/confirm.py
parentdb0ef2e25731a824aa728315f2f7f6e8a41a5ddf (diff)
downloadfork-ledger-04dfda2282bfb3686336600cfafd1d9653369445.tar.gz
fork-ledger-04dfda2282bfb3686336600cfafd1d9653369445.tar.bz2
fork-ledger-04dfda2282bfb3686336600cfafd1d9653369445.zip
Made separate modules for the csv command, since the prior method was
not fully correct.
Diffstat (limited to 'tests/confirm.py')
-rwxr-xr-xtests/confirm.py7
1 files changed, 5 insertions, 2 deletions
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)