summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCraig Earls <enderw88@gmail.com>2012-10-19 02:24:05 +0200
committerCraig Earls <enderw88@gmail.com>2012-10-19 02:24:05 +0200
commita110ec0af2c3d6b627b659353d2881e43003c907 (patch)
tree878259f96e59dcd9d2b61742298284db5a0e123e /test
parentc51ad98a6636b054fae1a8b2eca009ed516ee158 (diff)
parent08033e6d50dbe659b8393464eab119b00d8ba44a (diff)
downloadfork-ledger-a110ec0af2c3d6b627b659353d2881e43003c907.tar.gz
fork-ledger-a110ec0af2c3d6b627b659353d2881e43003c907.tar.bz2
fork-ledger-a110ec0af2c3d6b627b659353d2881e43003c907.zip
Merge branch 'next' of https://github.com/jwiegley/ledger into next
Diffstat (limited to 'test')
-rwxr-xr-xtest/RegressTests.py6
-rw-r--r--test/baseline/feat-convert-with-diretives.dat3
-rw-r--r--test/baseline/feat-convert-with-diretives.test28
3 files changed, 35 insertions, 2 deletions
diff --git a/test/RegressTests.py b/test/RegressTests.py
index 7d67eb21..1094d0d5 100755
--- a/test/RegressTests.py
+++ b/test/RegressTests.py
@@ -98,8 +98,10 @@ class RegressFile(object):
def run_test(self, test):
use_stdin = False
- if test['command'].find("-f - ") != -1:
- use_stdin = True
+ if test['command'].find("-f ") != -1:
+ test['command'] = '$ledger ' + test['command']
+ if test['command'].find("-f - ") != -1:
+ use_stdin = True
else:
test['command'] = (('$ledger -f "%s" ' %
os.path.abspath(self.filename)) +
diff --git a/test/baseline/feat-convert-with-diretives.dat b/test/baseline/feat-convert-with-diretives.dat
new file mode 100644
index 00000000..ac13ff81
--- /dev/null
+++ b/test/baseline/feat-convert-with-diretives.dat
@@ -0,0 +1,3 @@
+date,payee,amount
+2012/01/01,KFC,$10
+2012/01/02,"REWE SAGT DANKE 123454321",10€
diff --git a/test/baseline/feat-convert-with-diretives.test b/test/baseline/feat-convert-with-diretives.test
new file mode 100644
index 00000000..2f6e0102
--- /dev/null
+++ b/test/baseline/feat-convert-with-diretives.test
@@ -0,0 +1,28 @@
+account Expenses:Food
+ payee KFC
+ payee REWE
+
+payee REWE
+ alias REWE SAGT DANKE
+
+# When reading csv file without directives:
+test -f /dev/null convert test/baseline/feat-convert-with-diretives.dat
+2012/01/01 * KFC
+ Expenses:Unknown $10
+ Equity:Unknown
+
+2012/01/02 * REWE SAGT DANKE 123454321
+ Expenses:Unknown 10€
+ Equity:Unknown
+end test
+
+# When reading csv file with directives:
+test --account "Assets:Cash" convert test/baseline/feat-convert-with-diretives.dat
+2012/01/01 * KFC
+ Expenses:Food $10
+ Assets:Cash
+
+2012/01/02 * REWE
+ Expenses:Food 10€
+ Assets:Cash
+end test