summaryrefslogtreecommitdiff
path: root/test/baseline
diff options
context:
space:
mode:
Diffstat (limited to 'test/baseline')
-rw-r--r--test/baseline/cmd-accounts.test38
-rw-r--r--test/baseline/cmd-balance.test85
-rw-r--r--test/baseline/cmd-budget.test65
-rw-r--r--test/baseline/cmd-cleared.test36
-rw-r--r--test/baseline/cmd-commodities.test30
-rw-r--r--test/baseline/cmd-convert.test35
-rw-r--r--test/baseline/cmd-convert1.dat3
-rw-r--r--test/baseline/cmd-convert2.dat2
-rw-r--r--test/baseline/cmd-convert3.dat2
-rw-r--r--test/baseline/cmd-convert4.dat2
-rw-r--r--test/baseline/cmd-csv.test53
-rw-r--r--test/baseline/cmd-echo.test12
-rw-r--r--test/baseline/cmd-entry.test43
-rw-r--r--test/baseline/cmd-org.test28
-rw-r--r--test/baseline/cmd-payees.test48
-rw-r--r--test/baseline/cmd-pricedb.test39
-rw-r--r--test/baseline/cmd-pricemap.test36
-rw-r--r--test/baseline/cmd-prices.test39
-rw-r--r--test/baseline/cmd-register.test40
-rw-r--r--test/baseline/cmd-script.test21
-rw-r--r--test/baseline/cmd-select.test62
-rw-r--r--test/baseline/cmd-source.test64
-rw-r--r--test/baseline/cmd-stats.test31
-rw-r--r--test/baseline/cmd-xact.test43
-rw-r--r--test/baseline/dir-account.test45
-rw-r--r--test/baseline/dir-apply.dat3
-rw-r--r--test/baseline/dir-apply.test34
-rw-r--r--test/baseline/dir-commodity-alias.test23
-rw-r--r--test/baseline/dir-commodity-value.test24
-rw-r--r--test/baseline/dir-commodity.test21
-rw-r--r--test/baseline/dir-import_py.test23
-rw-r--r--test/baseline/dir-payee.test12
-rw-r--r--test/baseline/dir-python_py.test28
-rw-r--r--test/baseline/dir-tag.test21
-rw-r--r--test/baseline/feat-annotations.test37
-rw-r--r--test/baseline/feat-balance_assert.test13
-rw-r--r--test/baseline/feat-check.test4
-rw-r--r--test/baseline/feat-fixated-prices.test2
-rw-r--r--test/baseline/feat-fixated-prices_2.test4
-rw-r--r--test/baseline/feat-import_py.test23
-rw-r--r--test/baseline/feat-option_py.test14
-rw-r--r--test/baseline/feat-value-expr.test99
-rw-r--r--test/baseline/feat-value_py.test23
-rw-r--r--test/baseline/featimport.py4
-rw-r--r--test/baseline/featoption.py5
-rw-r--r--test/baseline/opt-auto-match.dat4
-rw-r--r--test/baseline/opt-auto-match.test30
-rw-r--r--test/baseline/opt-aux-date.test (renamed from test/baseline/opt-effective.test)0
-rw-r--r--test/baseline/opt-bold-if.test16
-rw-r--r--test/baseline/opt-budget-format.test21
-rw-r--r--test/baseline/opt-check-payees.test37
-rw-r--r--test/baseline/opt-count.test43
-rw-r--r--test/baseline/opt-day-break.test12
-rw-r--r--test/baseline/opt-dc.test16
-rw-r--r--test/baseline/opt-decimal-comma.test22
-rw-r--r--test/baseline/opt-deviation.test2
-rw-r--r--test/baseline/opt-equity.test61
-rw-r--r--test/baseline/opt-exchange.test57
-rw-r--r--test/baseline/opt-explicit.test34
-rw-r--r--test/baseline/opt-file.test12
-rw-r--r--test/baseline/opt-file1.dat4
-rw-r--r--test/baseline/opt-file2.dat4
-rw-r--r--test/baseline/opt-forecast-years.test202
-rw-r--r--test/baseline/opt-group-by.test114
-rw-r--r--test/baseline/opt-group-title-format.test48
-rw-r--r--test/baseline/opt-historical.test250
-rw-r--r--test/baseline/opt-immediate.test (renamed from test/baseline/opt-actual-dates.test)0
-rw-r--r--test/baseline/opt-inject.test10
-rw-r--r--test/baseline/opt-lot-notes.test31
-rw-r--r--test/baseline/opt-meta-width.test4
-rw-r--r--test/baseline/opt-no-pager.test0
-rw-r--r--test/baseline/opt-payee-as-account.test4
-rw-r--r--test/baseline/opt-pedantic.test17
-rw-r--r--test/baseline/opt-period.test2
-rw-r--r--test/baseline/opt-permissive.test0
-rw-r--r--test/baseline/opt-primary-date.test0
-rw-r--r--test/baseline/opt-rich-data.test0
-rw-r--r--test/baseline/opt-time-report.test0
-rw-r--r--test/baseline/opt-unround.test2
-rw-r--r--test/baseline/opt-value-expr.test0
-rw-r--r--test/baseline/opt-verify-memory.test0
81 files changed, 2361 insertions, 17 deletions
diff --git a/test/baseline/cmd-accounts.test b/test/baseline/cmd-accounts.test
new file mode 100644
index 00000000..be6365fd
--- /dev/null
+++ b/test/baseline/cmd-accounts.test
@@ -0,0 +1,38 @@
+2011-01-01 * Opening balance
+ Assets:Bank 10.00 GBP
+ Equity:Opening balance
+
+2012-01-02 * List XXX before AAA to test sorting
+ Assets:XXX 5.00 GBP
+ Assets:Bank
+
+2012-01-03 * List AAA after XXX to test sorting
+ Assets:AAA 3.00 GBP
+ Assets:Bank
+
+2012-01-03 * Account name with UTF-8
+ Assets:♚ 3.00 GBP
+ Assets:Testing123ÕßDone
+
+test accounts
+Assets:Bank
+Equity:Opening balance
+Assets:XXX
+Assets:AAA
+Assets:♚
+Assets:Testing123ÕßDone
+end test
+
+test accounts assets:a
+Assets:AAA
+end test
+
+test accounts b
+Assets:Bank
+Equity:Opening balance
+end test
+
+test accounts ß
+Assets:Testing123ÕßDone
+end test
+
diff --git a/test/baseline/cmd-balance.test b/test/baseline/cmd-balance.test
new file mode 100644
index 00000000..064a046d
--- /dev/null
+++ b/test/baseline/cmd-balance.test
@@ -0,0 +1,85 @@
+
+2012-01-01 * Opening balances
+ Assets:A 10.00
+ Equity:Opening balances -10.00
+
+2012-01-02 * A to B
+ Assets:A -10.00
+ Assets:B 10.00
+
+2012-01-03 * B partly to C
+ Assets:B -5.00
+ Assets:C 5.00
+
+2012-01-04 * Borrow
+ Assets:A 10.00
+ Liabilities:A -10.00
+
+2012-01-05 * Return A
+ Assets:A -10.00
+ Liabilities:A 10.00
+
+test bal
+ 10 Assets
+ 5 B
+ 5 C
+ -10 Equity:Opening balances
+--------------------
+ 0
+end test
+
+test bal -n
+ 10 Assets
+ -10 Equity
+--------------------
+ 0
+end test
+
+test bal -n -E
+ 10 Assets
+ -10 Equity
+ 0 Liabilities
+--------------------
+ 0
+end test
+
+test bal -E
+ 10 Assets
+ 0 A
+ 5 B
+ 5 C
+ -10 Equity:Opening balances
+ 0 Liabilities:A
+--------------------
+ 0
+end test
+
+test bal --flat
+ 5 Assets:B
+ 5 Assets:C
+ -10 Equity:Opening balances
+--------------------
+ 0
+end test
+
+test bal --flat -E
+ 0 Assets:A
+ 5 Assets:B
+ 5 Assets:C
+ -10 Equity:Opening balances
+ 0 Liabilities:A
+--------------------
+ 0
+end test
+
+test bal -E --flat --no-total
+ 0 Assets:A
+ 5 Assets:B
+ 5 Assets:C
+ -10 Equity:Opening balances
+ 0 Liabilities:A
+end test
+
+test bal -n --flat
+end test
+
diff --git a/test/baseline/cmd-budget.test b/test/baseline/cmd-budget.test
new file mode 100644
index 00000000..91d5a901
--- /dev/null
+++ b/test/baseline/cmd-budget.test
@@ -0,0 +1,65 @@
+~ Monthly
+ Expenses:Phone 10.00 GBP
+ Expenses:Rent 550.00 GBP
+ Assets
+
+2012-01-10 * Phone expense on holidays
+ Expenses:Phone 12.00 EUR @@ 10.00 GBP
+ Assets:Cash -10.00 GBP
+
+2012-01-31 * Rent expense
+ Expenses:Rent 550.00 GBP
+ Assets:Cash -550.00 GBP
+
+2012-02-28 * Phone expense
+ Expenses:Phone 20.00 GBP
+ Assets:Cash -20.00 GBP
+
+2012-02-29 * Rent expense
+ Expenses:Rent 530.00 GBP
+ Assets:Cash -530.00 GBP
+
+2012-03-10 * Phone expense
+ Expenses:Phone 15.00 GBP
+ Assets:Cash -15.00 GBP
+
+2012-03-31 * Rent expense
+ Expenses:Rent 570.00 GBP
+ Assets:Cash -570.00 GBP
+
+test budget -X GBP -p "in january 2012"
+ -560.00 GBP -560.00 GBP 0 100% Assets
+ 560.00 GBP 560.00 GBP 0 100% Expenses
+ 10.00 GBP 10.00 GBP 0 100% Phone
+ 550.00 GBP 550.00 GBP 0 100% Rent
+------------ ------------ ------------ -----
+ 0 0 0 0
+end test
+
+test budget -X GBP -p "in feb 2012"
+ -550.00 GBP -560.00 GBP 10.00 GBP 98% Assets
+ 550.00 GBP 560.00 GBP -10.00 GBP 98% Expenses
+ 20.00 GBP 10.00 GBP 10.00 GBP 200% Phone
+ 530.00 GBP 550.00 GBP -20.00 GBP 96% Rent
+------------ ------------ ------------ -----
+ 0 0 0 0
+end test
+
+test budget -X GBP -p "in march 2012"
+ -585.00 GBP -560.00 GBP -25.00 GBP 104% Assets
+ 585.00 GBP 560.00 GBP 25.00 GBP 104% Expenses
+ 15.00 GBP 10.00 GBP 5.00 GBP 150% Phone
+ 570.00 GBP 550.00 GBP 20.00 GBP 104% Rent
+------------ ------------ ------------ -----
+ 0 0 0 0
+end test
+
+test budget -X GBP --now "2012-03-31"
+-1695.00 GBP -1680.00 GBP -15.00 GBP 101% Assets
+ 1695.00 GBP 1680.00 GBP 15.00 GBP 101% Expenses
+ 45.00 GBP 30.00 GBP 15.00 GBP 150% Phone
+ 1650.00 GBP 1650.00 GBP 0 100% Rent
+------------ ------------ ------------ -----
+ 0 0 0 0
+end test
+
diff --git a/test/baseline/cmd-cleared.test b/test/baseline/cmd-cleared.test
new file mode 100644
index 00000000..501d207f
--- /dev/null
+++ b/test/baseline/cmd-cleared.test
@@ -0,0 +1,36 @@
+2012-02-23 * Test 1
+ A 10.00
+ B
+
+2012-02-24 Test 1
+ C 15.00
+ D
+
+; leave E/F uncleared
+2012-02-25 Test 1
+ E 20.00
+ F
+
+; have a cleared posting last for C
+2012-02-26 * Test 1
+ C 30.00
+ G
+
+; have an uncleared posting last for A
+2012-02-27 Test 1
+ A 40.00
+ H
+
+test cleared
+ 50 10 12-Feb-23 A
+ -10 -10 12-Feb-23 B
+ 45 30 12-Feb-26 C
+ -15 0 D
+ 20 0 E
+ -20 0 F
+ -30 -30 12-Feb-26 G
+ -40 0 H
+---------------- ---------------- ---------
+ 0 0
+end test
+
diff --git a/test/baseline/cmd-commodities.test b/test/baseline/cmd-commodities.test
new file mode 100644
index 00000000..0ce6f7a0
--- /dev/null
+++ b/test/baseline/cmd-commodities.test
@@ -0,0 +1,30 @@
+2011-01-01 * Opening balance
+ Assets:Bank 10.00 GBP
+ Equity:Opening balance
+
+2011-03-04 * Buy AAA
+ Assets:Broker 2 AAA @ 0.90 GBP
+ Assets:Bank -1.80 GBP
+
+2011-03-05 * Buy AA2
+ Assets:Broker 2 "AA2" @ 1.00 GBP
+ Assets:Bank
+
+2011-03-06 * Get Miles&More airmiles
+ Assets:Rewards 1000 "M&M"
+ Income:Rewards
+
+test commodities
+GBP
+AAA
+"AA2"
+"M&M"
+end test
+
+test commodities Assets:Rewards
+"M&M"
+end test
+
+test commodities no:such:account
+end test
+
diff --git a/test/baseline/cmd-convert.test b/test/baseline/cmd-convert.test
new file mode 100644
index 00000000..181165df
--- /dev/null
+++ b/test/baseline/cmd-convert.test
@@ -0,0 +1,35 @@
+
+test -f /dev/null --input-date-format "%m/%d/%Y" convert test/baseline/cmd-convert1.dat
+2011/12/12=2011/12/13 * (100) Test ;test
+ Expenses:Unknown $10
+ Equity:Unknown $-10 = $20
+
+2011/12/12=2011/12/12 * ;
+ Expenses:Unknown $10
+ Equity:Unknown
+end test
+
+test -f /dev/null --input-date-format "%m/%d/%Y" convert test/baseline/cmd-convert2.dat
+2011/01/01 * test
+ Expenses:Unknown 20.00 EUR
+ Equity:Unknown
+end test
+
+test -f /dev/null --input-date-format "%m/%d/%Y" convert test/baseline/cmd-convert3.dat -> 1
+__ERROR__
+While parsing file "test/baseline/cmd-convert3.dat", line 1:
+While parsing CSV line:
+ 01/01/2011,,
+
+Error: No quantity specified for amount
+end test
+
+test -f /dev/null convert test/baseline/cmd-convert4.dat -> 1
+__ERROR__
+While parsing file "test/baseline/cmd-convert4.dat", line 1:
+While parsing CSV line:
+ bogus,$10,
+
+Error: Invalid date: bogus
+end test
+
diff --git a/test/baseline/cmd-convert1.dat b/test/baseline/cmd-convert1.dat
new file mode 100644
index 00000000..542a19e3
--- /dev/null
+++ b/test/baseline/cmd-convert1.dat
@@ -0,0 +1,3 @@
+date,posted,code,payee,amount,total,note,
+12/12/2011,12/13/2011,100,Test,$10,$20,test,
+12/12/2011,12/12/2011,,,$10,,
diff --git a/test/baseline/cmd-convert2.dat b/test/baseline/cmd-convert2.dat
new file mode 100644
index 00000000..190095c3
--- /dev/null
+++ b/test/baseline/cmd-convert2.dat
@@ -0,0 +1,2 @@
+date,amount,desc,
+01/01/2011,20.00 EUR,test,
diff --git a/test/baseline/cmd-convert3.dat b/test/baseline/cmd-convert3.dat
new file mode 100644
index 00000000..7c31d986
--- /dev/null
+++ b/test/baseline/cmd-convert3.dat
@@ -0,0 +1,2 @@
+date,amount,
+01/01/2011,,
diff --git a/test/baseline/cmd-convert4.dat b/test/baseline/cmd-convert4.dat
new file mode 100644
index 00000000..644f6806
--- /dev/null
+++ b/test/baseline/cmd-convert4.dat
@@ -0,0 +1,2 @@
+date,amount,
+bogus,$10,
diff --git a/test/baseline/cmd-csv.test b/test/baseline/cmd-csv.test
new file mode 100644
index 00000000..110e3d58
--- /dev/null
+++ b/test/baseline/cmd-csv.test
@@ -0,0 +1,53 @@
+
+2012-01-01 * Opening balances
+ Assets:A 10.00
+ Equity:Opening balances -10.00
+
+2012-01-02 * Cleared posting
+ Assets:A -10.00
+ Assets:B 10.00
+
+2012-01-03 Uncleared posting
+ Assets:B -5.00
+ Assets:C 5.00
+
+2012-01-04=2012-01-05 * aux date
+ Assets:A 10.00
+ Liabilities:A -10.00
+
+2012-01-05 * (100) Code
+ Assets:A -10.00
+ Liabilities:A 10.00
+
+2012-01-06 * (100) Specify commodity
+ Assets:A $-10.00
+ Liabilities:A $10.00
+
+2012-01-07 * (100) Specify commodity
+ Assets:A -10.00 EUR
+ Liabilities:A 10.00 EUR
+
+2012-01-08 * (100) With note
+ ;This is an xact note
+ Assets:A -10.00 EUR
+ Liabilities:A 10.00 EUR
+
+test csv
+"2012/01/01","","Opening balances","Assets:A","","10","*",""
+"2012/01/01","","Opening balances","Equity:Opening balances","","-10","*",""
+"2012/01/02","","Cleared posting","Assets:A","","-10","*",""
+"2012/01/02","","Cleared posting","Assets:B","","10","*",""
+"2012/01/03","","Uncleared posting","Assets:B","","-5","",""
+"2012/01/03","","Uncleared posting","Assets:C","","5","",""
+"2012/01/04","","aux date","Assets:A","","10","*",""
+"2012/01/04","","aux date","Liabilities:A","","-10","*",""
+"2012/01/05","100","Code","Assets:A","","-10","*",""
+"2012/01/05","100","Code","Liabilities:A","","10","*",""
+"2012/01/06","100","Specify commodity","Assets:A","$","-10","*",""
+"2012/01/06","100","Specify commodity","Liabilities:A","$","10","*",""
+"2012/01/07","100","Specify commodity","Assets:A","EUR","-10","*",""
+"2012/01/07","100","Specify commodity","Liabilities:A","EUR","10","*",""
+"2012/01/08","100","With note","Assets:A","EUR","-10","*","This is an xact note"
+"2012/01/08","100","With note","Liabilities:A","EUR","10","*","This is an xact note"
+end test
+
diff --git a/test/baseline/cmd-echo.test b/test/baseline/cmd-echo.test
new file mode 100644
index 00000000..af3d06ec
--- /dev/null
+++ b/test/baseline/cmd-echo.test
@@ -0,0 +1,12 @@
+test echo foo
+foo
+end test
+
+test echo "foo bar"
+foo bar
+end test
+
+test echo "foo\nbar"
+foo\nbar
+end test
+
diff --git a/test/baseline/cmd-entry.test b/test/baseline/cmd-entry.test
new file mode 100644
index 00000000..0de39b9c
--- /dev/null
+++ b/test/baseline/cmd-entry.test
@@ -0,0 +1,43 @@
+2012-03-23 * Test 1
+ A $10.00
+ B
+
+2012-03-24 * Test 2
+ ; Payee: Test 3
+ C 20.00 EUR
+ D
+
+2012-03-25 * Test 4
+ E 30.00 GBP
+ F
+
+test --now 2012/03/25 entry "Test 1"
+2012/03/25 Test 1
+ A $10.00
+ B
+end test
+
+test --now 2012/03/25 entry "Test 2"
+2012/03/25 Test 2
+ C 20.00 EUR
+ D
+end test
+
+; I think this output is wrong, see bug #737
+test --now 2012/03/25 entry "Test 3"
+2012/03/25 Test 4
+ E 30.00 GBP
+ F
+end test
+
+test --now 2012/03/25 entry "Test 4"
+2012/03/25 Test 4
+ E 30.00 GBP
+ F
+end test
+
+test entry no:such:account -> 1
+__ERROR__
+Error: No accounts, and no past transaction matching 'no:such:account'
+end test
+
diff --git a/test/baseline/cmd-org.test b/test/baseline/cmd-org.test
new file mode 100644
index 00000000..12a380f5
--- /dev/null
+++ b/test/baseline/cmd-org.test
@@ -0,0 +1,28 @@
+2012-03-24 * Test 2
+ ; Payee: Test 3
+ C 20.00 EUR
+ D
+
+2012-03-25 * (99) Test 4
+ E 30.00 GBP
+ F
+
+2012-03-26 * (test) Test 5
+ G 1 AAA @ $10.00
+ H
+
+test org
+|Date|Code|Payee|X|Account|Amount|Total|Note|
+|-|
+|||<20>|||<r>|<r>|<20>|
+|12-Mar-24||Test 3|*|C|20.00 EUR|20.00 EUR| Payee: Test 3
+|||Test 3|*|D|-20.00 EUR|0.00 EUR| Payee: Test 3
+|12-Mar-25|99|Test 4|*|E|30.00 GBP|30.00 GBP|
+||||*|F|-30.00 GBP|0.00 GBP|
+|12-Mar-26|test|Test 5|*|G|1 AAA|0.00 GBP|
+|||||||1 AAA|
+||||*|H|$-10|0.00 GBP|
+|||||||$-10|
+|||||||1 AAA|
+end test
+
diff --git a/test/baseline/cmd-payees.test b/test/baseline/cmd-payees.test
new file mode 100644
index 00000000..64d6bcf5
--- /dev/null
+++ b/test/baseline/cmd-payees.test
@@ -0,0 +1,48 @@
+2011-03-01 * Z
+ A 10
+ B
+
+2011-03-02 * A
+ C 10
+ D
+
+2011-03-03 * 9
+ B 10
+ E
+
+2011-03-04 * B
+ B 10
+ E
+
+2011-03-05 * 1
+ B 10
+ E
+
+2011-03-06 * 2
+ ; Payee: 3
+ E 10
+ F
+
+test payees
+1
+3
+9
+A
+B
+Z
+end test
+
+test payees a
+Z
+end test
+
+test payees no:such:account
+end test
+
+test payees "^B$"
+1
+9
+B
+Z
+end test
+
diff --git a/test/baseline/cmd-pricedb.test b/test/baseline/cmd-pricedb.test
new file mode 100644
index 00000000..4a220054
--- /dev/null
+++ b/test/baseline/cmd-pricedb.test
@@ -0,0 +1,39 @@
+2012-01-01 * Opening balance
+ A 10.00 GBP
+ B
+
+2012-01-02 * Test
+ A 10.00 GBP @@ 12.00 EUR
+ B
+
+2012-01-03 * Test
+ B 12.00 EUR @@ 15.80 USD
+ C
+
+2012-01-04 * Test
+ C 15.80 USD @ 0.63 GBP
+ D
+
+test pricedb
+P 2012/01/02 00:00:00 GBP 1.20 EUR
+P 2012/01/03 00:00:00 EUR 1.3166666667 USD
+P 2012/01/04 00:00:00 USD 0.63 GBP
+end test
+
+test pricedb EUR
+P 2012/01/03 00:00:00 EUR 1.3166666667 USD
+end test
+
+test pricedb GBP
+P 2012/01/02 00:00:00 GBP 1.20 EUR
+end test
+
+test pricedb USD
+P 2012/01/04 00:00:00 USD 0.63 GBP
+end test
+
+test pricedb U
+P 2012/01/03 00:00:00 EUR 1.3166666667 USD
+P 2012/01/04 00:00:00 USD 0.63 GBP
+end test
+
diff --git a/test/baseline/cmd-pricemap.test b/test/baseline/cmd-pricemap.test
new file mode 100644
index 00000000..6fbaa2fe
--- /dev/null
+++ b/test/baseline/cmd-pricemap.test
@@ -0,0 +1,36 @@
+P 2012-03-25 EUR 0.83 GBP
+P 2012-03-25 EUR 1.32 $
+P 2012-03-25 USD 0.75 EUR
+P 2012-03-25 AAA $10.00
+
+2012-03-23 * Test 1
+ C 20.00 EUR @@ 16.71 GBP
+ D
+
+2012-03-24 * Test 2
+ E 30.00 GBP
+ F
+
+2012-03-25 * Test 3
+ G 1 AAA @ $10.00
+ H
+
+test pricemap
+graph G {
+0[label=""];
+1[label="s"];
+2[label="%"];
+3[label="m"];
+4[label="h"];
+5[label="GBP"];
+6[label="EUR"];
+7[label="$"];
+8[label="USD"];
+9[label="AAA"];
+6--5 ;
+6--7 ;
+8--6 ;
+9--7 ;
+}
+end test
+
diff --git a/test/baseline/cmd-prices.test b/test/baseline/cmd-prices.test
new file mode 100644
index 00000000..ee2b4ba1
--- /dev/null
+++ b/test/baseline/cmd-prices.test
@@ -0,0 +1,39 @@
+2012-01-01 * Opening balance
+ A 10.00 GBP
+ B
+
+2012-01-02 * Test
+ A 10.00 GBP @@ 12.00 EUR
+ B
+
+2012-01-03 * Test
+ B 12.00 EUR @@ 15.80 USD
+ C
+
+2012-01-04 * Test
+ C 15.80 USD @ 0.63 GBP
+ D
+
+test prices
+2012/01/02 GBP 1.20 EUR
+2012/01/03 EUR 1.3166666667 USD
+2012/01/04 USD 0.63 GBP
+end test
+
+test prices EUR
+2012/01/03 EUR 1.3166666667 USD
+end test
+
+test prices USD
+2012/01/04 USD 0.63 GBP
+end test
+
+test prices GBP
+2012/01/02 GBP 1.20 EUR
+end test
+
+test prices U
+2012/01/03 EUR 1.3166666667 USD
+2012/01/04 USD 0.63 GBP
+end test
+
diff --git a/test/baseline/cmd-register.test b/test/baseline/cmd-register.test
new file mode 100644
index 00000000..afb78fb0
--- /dev/null
+++ b/test/baseline/cmd-register.test
@@ -0,0 +1,40 @@
+2012-01-10 * Phone expense on holidays
+ Expenses:Phone 12.00 EUR @@ 10.00 GBP
+ Assets:Cash -10.00 GBP
+
+2012-01-31 * Rent expense
+ Expenses:Rent 550.00 GBP
+ Assets:Cash -550.00 GBP
+
+2012-02-01 * Buy AAA
+ Assets:Investment 1 AAA @ 10.00 GBP
+ Assets:Cash -10.00 GBP
+
+test reg
+12-Jan-10 Phone expense on ho.. Expenses:Phone 12.00 EUR 12.00 EUR
+ Assets:Cash -10.00 GBP 12.00 EUR
+ -10.00 GBP
+12-Jan-31 Rent expense Expenses:Rent 550.00 GBP 12.00 EUR
+ 540.00 GBP
+ Assets:Cash -550.00 GBP 12.00 EUR
+ -10.00 GBP
+12-Feb-01 Buy AAA Assets:Investment 1 AAA 1 AAA
+ 12.00 EUR
+ -10.00 GBP
+ Assets:Cash -10.00 GBP 1 AAA
+ 12.00 EUR
+ -20.00 GBP
+end test
+
+test r :inve
+12-Feb-01 Buy AAA Assets:Investment 1 AAA 1 AAA
+end test
+
+test reg :inve
+12-Feb-01 Buy AAA Assets:Investment 1 AAA 1 AAA
+end test
+
+test register :inve
+12-Feb-01 Buy AAA Assets:Investment 1 AAA 1 AAA
+end test
+
diff --git a/test/baseline/cmd-script.test b/test/baseline/cmd-script.test
new file mode 100644
index 00000000..b33dd82d
--- /dev/null
+++ b/test/baseline/cmd-script.test
@@ -0,0 +1,21 @@
+test eval 'foo(w, u)=(z=w+u;z*2); (a=1 + 1; foo(10, 15))'
+50
+end test
+
+test eval 'foo(x, y, z)=print(x, y, z); bar(x)=x; foo(1, 2, 3); bar(3)'
+123
+3
+end test
+
+test eval 'total_expr=$100;amount_expr=$15;x=total_expr;x=x/5;x=amount_expr-x*5;x'
+$-85
+end test
+
+test eval 'foo = x, y, z -> print(x, y, z); foo(1, 2, 3)'
+123
+1
+end test
+
+test eval 'foo(x,y)=y(1, 2, 3);foo(amount_expr, (s,d,t -> t))'
+3
+end test
diff --git a/test/baseline/cmd-select.test b/test/baseline/cmd-select.test
new file mode 100644
index 00000000..c8ce7008
--- /dev/null
+++ b/test/baseline/cmd-select.test
@@ -0,0 +1,62 @@
+2012-02-28 * Test 1
+ E 20.00 EUR
+ F
+
+2012-02-29 * Test 2
+ Test 10.01 EUR
+ F
+
+2012-03-24 Test 3
+ C 30.00 EUR
+ D
+
+2012-03-25 (test) Test 4
+ ; Payee: Test 5
+ E 40.00 GBP
+ F
+
+test select "date, account, amount" from posts
+12-Feb-28 E  20.00 EUR
+12-Feb-28 F  -20.00 EUR
+12-Feb-29 Test  10.01 EUR
+12-Feb-29 F  -10.01 EUR
+12-Mar-24 C  30.00 EUR
+12-Mar-24 D  -30.00 EUR
+12-Mar-25 E  40.00 GBP
+12-Mar-25 F  -40.00 GBP
+end test
+
+test select "date, account, amount from posts where account =~ /^e/"
+12-Feb-28 E  20.00 EUR
+12-Mar-25 E  40.00 GBP
+end test
+
+test select "date, account, amount from posts where account =~ /e/"
+12-Feb-28 E  20.00 EUR
+12-Feb-29 Test  10.01 EUR
+12-Mar-25 E  40.00 GBP
+end test
+
+; leave out "from posts" since it is the default
+test select "date, account, amount where account =~ /e/"
+12-Feb-28 E  20.00 EUR
+12-Feb-29 Test  10.01 EUR
+12-Mar-25 E  40.00 GBP
+end test
+
+test select "date, payee, amount from posts where account =~ /e/ and commodity =~ /GBP/"
+12-Mar-25 Test 5 40.00 GBP
+end test
+
+test select "date, payee, amount * 2 from posts where account =~ /e/ and commodity =~ /GBP/"
+12-Mar-25 Test 5 80.00 GBP
+end test
+
+test select "date, code, amount from posts where account =~ /e/ and commodity =~ /GBP/"
+12-Mar-25 test 40.00 GBP
+end test
+
+test select "date, code * 2, amount from posts where account =~ /e/ and commodity =~ /GBP/"
+12-Mar-25 testtest 40.00 GBP
+end test
+
diff --git a/test/baseline/cmd-source.test b/test/baseline/cmd-source.test
new file mode 100644
index 00000000..95a10924
--- /dev/null
+++ b/test/baseline/cmd-source.test
@@ -0,0 +1,64 @@
+~ xxx
+
+2012-02-28 * Test
+ E 30.00 EUR
+ F
+ G
+
+2012-03-24 Test
+ C 30.00 EUR
+ D
+ C
+
+2012/03/xx
+ E 30.00 EUR
+ F
+
+2012-03-25 * Test
+ G AAA
+ H
+
+2012-03-26 * Test
+ I 1,00.00 EUR
+ J -100.00 EUR
+
+2012-03-27 * Test
+ K 100.00 EUR
+ L -200.00 EUR
+
+test source -> 7
+__ERROR__
+While parsing file "$FILE", line 1:
+While parsing periodic transaction:
+> ~ xxx
+Error: Unexpected date period token 'xxx'
+While parsing file "$FILE", line 6:
+Error: Only one posting with null amount allowed per transaction
+While parsing file "$FILE", line 11:
+Error: Only one posting with null amount allowed per transaction
+While parsing file "$FILE", line 13:
+While parsing transaction:
+> 2012/03/xx
+Error: Invalid date: 2012/03/xx
+While parsing file "$FILE", line 18:
+While parsing posting:
+ G AAA
+ ^^^
+Error: No quantity specified for amount
+While parsing file "$FILE", line 22:
+While parsing posting:
+ I 1,00.00 EUR
+ ^^^^^^^^^^^
+Error: Incorrect use of thousand-mark comma
+While parsing file "$FILE", line 27:
+While balancing transaction from "$FILE", lines 25-27:
+> 2012-03-27 * Test
+> K 100.00 EUR
+> L -200.00 EUR
+Unbalanced remainder is:
+ -100.00 EUR
+Amount to balance against:
+ 100.00 EUR
+Error: Transaction does not balance
+end test
+
diff --git a/test/baseline/cmd-stats.test b/test/baseline/cmd-stats.test
new file mode 100644
index 00000000..ac8e1383
--- /dev/null
+++ b/test/baseline/cmd-stats.test
@@ -0,0 +1,31 @@
+
+2012-02-28 * Test
+ E 30.00 EUR
+ F
+
+2012-02-29 * Test
+ E 30.00 EUR
+ F
+
+2012-03-24 Test
+ A 30.00 EUR
+ B
+
+test stats --now "2012-03-31"
+Time period: 12-Feb-28 to 12-Mar-24 (25 days)
+
+ Files these postings came from:
+ $sourcepath/test/baseline/cmd-stats.test
+
+ Unique payees: 1
+ Unique accounts: 4
+
+ Number of postings: 6 (0.24 per day)
+ Uncleared postings: 2
+
+ Days since last post: 7
+ Posts in last 7 days: 2
+ Posts in last 30 days: 2
+ Posts seen this month: 2
+end test
+
diff --git a/test/baseline/cmd-xact.test b/test/baseline/cmd-xact.test
new file mode 100644
index 00000000..6f4ee014
--- /dev/null
+++ b/test/baseline/cmd-xact.test
@@ -0,0 +1,43 @@
+2012-03-23 * Test 1
+ A $10.00
+ B
+
+2012-03-24 * Test 2
+ ; Payee: Test 3
+ C 20.00 EUR
+ D
+
+2012-03-25 * Test 4
+ E 30.00 GBP
+ F
+
+test --now 2012/03/25 xact "Test 1"
+2012/03/25 Test 1
+ A $10.00
+ B
+end test
+
+test --now 2012/03/25 xact "Test 2"
+2012/03/25 Test 2
+ C 20.00 EUR
+ D
+end test
+
+; I think this output is wrong, see bug #737
+test --now 2012/03/25 xact "Test 3"
+2012/03/25 Test 4
+ E 30.00 GBP
+ F
+end test
+
+test --now 2012/03/25 xact "Test 4"
+2012/03/25 Test 4
+ E 30.00 GBP
+ F
+end test
+
+test xact no:such:account -> 1
+__ERROR__
+Error: No accounts, and no past transaction matching 'no:such:account'
+end test
+
diff --git a/test/baseline/dir-account.test b/test/baseline/dir-account.test
new file mode 100644
index 00000000..e8c3fc54
--- /dev/null
+++ b/test/baseline/dir-account.test
@@ -0,0 +1,45 @@
+--explicit
+--pedantic
+
+commodity $
+ format $1,000.00
+
+account Assets:Cash
+ check abs(amount) <= 20
+ check commodity == '$'
+ default
+
+account Expenses:Food
+ alias food
+ payee KFC
+
+2012-02-27 KFC
+ Expenses:Unknown $20.00
+ Assets:Cash
+
+2012-02-28 KFC
+ food $20.00
+ Assets:Cash
+
+2012-02-29 KFC
+ food $25.00
+ Assets:Cash
+
+2012-02-29 KFC
+ food $25.00
+ Assets:Cash
+
+test reg
+12-Feb-27 KFC Expenses:Food $20.00 $20.00
+ Assets:Cash $-20.00 0
+12-Feb-28 KFC Expenses:Food $20.00 $20.00
+ Assets:Cash $-20.00 0
+12-Feb-29 KFC Expenses:Food $25.00 $25.00
+ Assets:Cash $-25.00 0
+12-Feb-29 KFC Expenses:Food $25.00 $25.00
+ Assets:Cash $-25.00 0
+__ERROR__
+Warning: "$FILE", line 26: Transaction check failed: (abs(amount) <= {20})
+Warning: "$FILE", line 30: Transaction check failed: (abs(amount) <= {20})
+end test
+
diff --git a/test/baseline/dir-apply.dat b/test/baseline/dir-apply.dat
new file mode 100644
index 00000000..bcdcacf1
--- /dev/null
+++ b/test/baseline/dir-apply.dat
@@ -0,0 +1,3 @@
+2012-03-12 KFC
+ Expenses:Food $40
+ Assets:Cash
diff --git a/test/baseline/dir-apply.test b/test/baseline/dir-apply.test
new file mode 100644
index 00000000..7d9e91d9
--- /dev/null
+++ b/test/baseline/dir-apply.test
@@ -0,0 +1,34 @@
+apply account Master Account
+
+2012-03-12 KFC
+ Expenses:Food $20
+ Assets:Cash
+
+end apply account
+
+apply account Master Account
+
+2012-03-12 KFC
+ Expenses:Food $20
+ Assets:Cash
+
+end apply
+
+apply account Master Account
+
+2012-03-12 KFC
+ Expenses:Food $20
+ Assets:Cash
+
+end
+
+apply account Master Account
+include dir-apply.dat
+end
+
+test reg food
+12-Mar-12 KFC Master A:Expenses:Food $20 $20
+12-Mar-12 KFC Master A:Expenses:Food $20 $40
+12-Mar-12 KFC Master A:Expenses:Food $20 $60
+12-Mar-12 KFC Master A:Expenses:Food $40 $100
+end test
diff --git a/test/baseline/dir-commodity-alias.test b/test/baseline/dir-commodity-alias.test
new file mode 100644
index 00000000..4de7f406
--- /dev/null
+++ b/test/baseline/dir-commodity-alias.test
@@ -0,0 +1,23 @@
+commodity $
+ alias USD
+
+2012-03-12 * $
+ A $10.00
+ B
+
+2012-03-12 * USD
+ A 15.00 USD
+ B
+
+test bal
+ 25.00 $ A
+ -25.00 $ B
+--------------------
+ 0
+end test
+
+test reg a
+12-Mar-12 $ A 10.00 $ 10.00 $
+12-Mar-12 USD A 15.00 $ 25.00 $
+end test
+
diff --git a/test/baseline/dir-commodity-value.test b/test/baseline/dir-commodity-value.test
new file mode 100644
index 00000000..5e8fe789
--- /dev/null
+++ b/test/baseline/dir-commodity-value.test
@@ -0,0 +1,24 @@
+commodity $
+ value 10 EUR
+
+commodity USD
+ alias FOO
+ value 25 EUR
+
+2012-03-06 KFC
+ Expenses:Food $20.00
+ Assets:Cash
+
+2012-03-08 KFC
+ Expenses:Food USD 750,00
+ Assets:Cash
+
+2012-03-10 KFC
+ Expenses:Food USD 750,00
+ Assets:Cash
+
+test reg food -X EUR --now=2012-03-15
+12-Mar-06 KFC Expenses:Food 200 EUR 200 EUR
+12-Mar-08 KFC Expenses:Food 18750 EUR 18950 EUR
+12-Mar-10 KFC Expenses:Food 18750 EUR 37700 EUR
+end test
diff --git a/test/baseline/dir-commodity.test b/test/baseline/dir-commodity.test
new file mode 100644
index 00000000..fc925648
--- /dev/null
+++ b/test/baseline/dir-commodity.test
@@ -0,0 +1,21 @@
+account A
+account B
+commodity GBP
+
+2012-03-25 GBP
+ A 10.00 GBP
+ B
+
+2012-03-26 EUR
+ A 20.00 EUR
+ B
+
+test bal --pedantic -> 1
+__ERROR__
+While parsing file "$FILE", line 10:
+While parsing posting:
+ A 20.00 EUR
+ ^^^^^^^^^
+Error: Unknown commodity 'EUR'
+end test
+
diff --git a/test/baseline/dir-import_py.test b/test/baseline/dir-import_py.test
new file mode 100644
index 00000000..ee9f6001
--- /dev/null
+++ b/test/baseline/dir-import_py.test
@@ -0,0 +1,23 @@
+import os
+
+tag PATH
+ check os.path.isfile(value)
+
+2012-02-29 KFC
+ ; PATH: test/baseline/feat-import_py.test
+ Expenses:Food $20
+ Assets:Cash
+
+2012-02-29 KFC
+ ; PATH: test/baseline/feat-import_noexist.test
+ Expenses:Food $20
+ Assets:Cash
+
+test reg
+12-Feb-29 KFC Expenses:Food $20 $20
+ Assets:Cash $-20 0
+12-Feb-29 KFC Expenses:Food $20 $20
+ Assets:Cash $-20 0
+__ERROR__
+Warning: "$sourcepath/test/baseline/dir-import_py.test", line 14: Metadata check failed for (PATH: test/baseline/feat-import_noexist.test): ((os.path).isfile(value))
+end test
diff --git a/test/baseline/dir-payee.test b/test/baseline/dir-payee.test
new file mode 100644
index 00000000..b81bbc2b
--- /dev/null
+++ b/test/baseline/dir-payee.test
@@ -0,0 +1,12 @@
+payee KFC
+ alias Kentucky Fried Chicken
+
+2012-03-25 * Kentucky Fried Chicken
+ A 10
+ B
+
+test reg
+12-Mar-25 KFC A 10 10
+ B -10 0
+end test
+
diff --git a/test/baseline/dir-python_py.test b/test/baseline/dir-python_py.test
new file mode 100644
index 00000000..99ff4b1b
--- /dev/null
+++ b/test/baseline/dir-python_py.test
@@ -0,0 +1,28 @@
+python
+ import os
+ def check_path(path):
+ return os.path.isfile(path)
+
+tag PATH
+ check check_path(value)
+ check os.path.isfile(value)
+
+2012-02-29 KFC
+ ; PATH: test/baseline/feat-import_py.test
+ Expenses:Food $20
+ Assets:Cash
+
+2012-02-29 KFC
+ ; PATH: test/baseline/feat-import_noexist.test
+ Expenses:Food $20
+ Assets:Cash
+
+test reg
+12-Feb-29 KFC Expenses:Food $20 $20
+ Assets:Cash $-20 0
+12-Feb-29 KFC Expenses:Food $20 $20
+ Assets:Cash $-20 0
+__ERROR__
+Warning: "$sourcepath/test/baseline/dir-python_py.test", line 18: Metadata check failed for (PATH: test/baseline/feat-import_noexist.test): check_path(value)
+Warning: "$sourcepath/test/baseline/dir-python_py.test", line 18: Metadata check failed for (PATH: test/baseline/feat-import_noexist.test): ((os.path).isfile(value))
+end test
diff --git a/test/baseline/dir-tag.test b/test/baseline/dir-tag.test
new file mode 100644
index 00000000..cf668f29
--- /dev/null
+++ b/test/baseline/dir-tag.test
@@ -0,0 +1,21 @@
+tag Happy
+ check value == 'Valley'
+
+2012-02-27 * KFC
+ ; Happy: Valley
+ Expenses:Unknown $20.00
+ ; Happy: Summer
+ Assets:Cash
+
+2012-02-28 * KFC
+ food $20.00
+ Assets:Cash
+
+test reg
+12-Feb-27 KFC Expenses:Unknown $20.00 $20.00
+ Assets:Cash $-20.00 0
+12-Feb-28 KFC food $20.00 $20.00
+ Assets:Cash $-20.00 0
+__ERROR__
+Warning: "$sourcepath/test/baseline/dir-tag.test", line 8: Metadata check failed for (Happy: Summer): (value == "Valley")
+end test
diff --git a/test/baseline/feat-annotations.test b/test/baseline/feat-annotations.test
new file mode 100644
index 00000000..18f5d7d9
--- /dev/null
+++ b/test/baseline/feat-annotations.test
@@ -0,0 +1,37 @@
+2012-03-09 KFC
+ Expenses:Food 10 CHIK @ $50
+ Assets:Cash
+
+2012-03-09 KFC
+ Assets:Cash $75
+ Expenses:Food -10 CHIK {{$50}} @ $75
+ Equity:Capital Gains $-25
+
+2012-03-09 KFC
+ Expenses:Food 10 CHIK
+ Assets:Cash $-50
+
+2012-03-09 KFC
+ Assets:Cash $75
+ Expenses:Food -10 CHIK {{$50}}
+ Equity:Capital Gains $-25
+
+test print
+2012/03/09 KFC
+ Expenses:Food 10 CHIK @ $50
+ Assets:Cash
+
+2012/03/09 KFC
+ Assets:Cash $75
+ Expenses:Food -10 CHIK {$5} @ $75
+ Equity:Capital Gains $-25
+
+2012/03/09 KFC
+ Expenses:Food 10 CHIK
+ Assets:Cash $-50
+
+2012/03/09 KFC
+ Assets:Cash $75
+ Expenses:Food -10 CHIK {$5}
+ Equity:Capital Gains $-25
+end test
diff --git a/test/baseline/feat-balance_assert.test b/test/baseline/feat-balance_assert.test
new file mode 100644
index 00000000..a03cbb0e
--- /dev/null
+++ b/test/baseline/feat-balance_assert.test
@@ -0,0 +1,13 @@
+2012-01-01 Opening Balance
+ Assets:Checking $100
+ Equity
+
+2012-01-01 Reconciliation
+ [Assets:Checking] = $100
+
+test balance
+ $100 Assets:Checking
+ $-100 Equity
+--------------------
+ 0
+end test
diff --git a/test/baseline/feat-check.test b/test/baseline/feat-check.test
index a5f0c8ad..a9db1ec4 100644
--- a/test/baseline/feat-check.test
+++ b/test/baseline/feat-check.test
@@ -13,6 +13,6 @@ test bal
--------------------
0
__ERROR__
-Warning: Transaction check failed: (account =~ /Foo/)
-Warning: Check failed: account("Assets:Checking").all(account =~ /Expense/)
+Warning: "$sourcepath/test/baseline/feat-check.test", line 6: Transaction check failed: (account =~ /Foo/)
+Warning: "$sourcepath/test/baseline/feat-check.test", line 8: Check failed: account("Assets:Checking").all(account =~ /Expense/)
end test
diff --git a/test/baseline/feat-fixated-prices.test b/test/baseline/feat-fixated-prices.test
index f4370870..4767d866 100644
--- a/test/baseline/feat-fixated-prices.test
+++ b/test/baseline/feat-fixated-prices.test
@@ -1,3 +1,5 @@
+P 1989/01/15 12:00:00 GAL $3
+
1990/01/01 Payee
Expenses:Gas 100 GAL {=$2}
Liabilities:MasterCard $-200
diff --git a/test/baseline/feat-fixated-prices_2.test b/test/baseline/feat-fixated-prices_2.test
index b7b71c83..ecbdfe9a 100644
--- a/test/baseline/feat-fixated-prices_2.test
+++ b/test/baseline/feat-fixated-prices_2.test
@@ -1,10 +1,10 @@
-fixed XCD $0.374531835206
+apply fixed XCD $0.374531835206
2008/04/08 KFC
Expenses:Food XCD 43.00
Assets:Cash
-end fixed
+end apply fixed
test reg
08-Apr-08 KFC Expenses:Food XCD 43.00 XCD 43.00
diff --git a/test/baseline/feat-import_py.test b/test/baseline/feat-import_py.test
new file mode 100644
index 00000000..6bd77586
--- /dev/null
+++ b/test/baseline/feat-import_py.test
@@ -0,0 +1,23 @@
+--import featimport.py
+
+tag PATH
+ check check_path(value)
+
+2012-02-29 KFC
+ ; PATH: test/baseline/feat-import_py.test
+ Expenses:Food $20
+ Assets:Cash
+
+2012-02-29 KFC
+ ; PATH: test/baseline/feat-import_noexist.test
+ Expenses:Food $20
+ Assets:Cash
+
+test reg
+12-Feb-29 KFC Expenses:Food $20 $20
+ Assets:Cash $-20 0
+12-Feb-29 KFC Expenses:Food $20 $20
+ Assets:Cash $-20 0
+__ERROR__
+Warning: "$sourcepath/test/baseline/feat-import_py.test", line 14: Metadata check failed for (PATH: test/baseline/feat-import_noexist.test): check_path(value)
+end test
diff --git a/test/baseline/feat-option_py.test b/test/baseline/feat-option_py.test
new file mode 100644
index 00000000..1b2a0c79
--- /dev/null
+++ b/test/baseline/feat-option_py.test
@@ -0,0 +1,14 @@
+python
+ def option_pyfirst(context):
+ print "In --pyfirst (from %s)" % context
+
+ def option_pysecond(context, val):
+ print "In --pysecond=%s (from %s)" % (val, context)
+
+--pyfirst
+--pysecond Hey
+
+test reg
+In --pyfirst (from $FILE)
+In --pysecond=Hey (from $FILE)
+end test
diff --git a/test/baseline/feat-value-expr.test b/test/baseline/feat-value-expr.test
new file mode 100644
index 00000000..01f9780b
--- /dev/null
+++ b/test/baseline/feat-value-expr.test
@@ -0,0 +1,99 @@
+;; A valuation function receives three arguments:
+;;
+;; 'source' A string identifying the commodity whose price
+;; is being asked for (example: "EUR")
+;;
+;; 'date' The reference date the price should be relative.
+;;
+;; 'target' A string identifying the "target" commodity, or
+;; the commodity the returned price should be in.
+;; This argument is null if -V was used instead of -X.
+;;
+;; The valuation function should return an amount. If you've written your
+;; function in Python, you can return something like Amount("$100"). If the
+;; function returns an explicit value, that value is always used, regardless
+;; of the commodity, the date, or the desired target commodity.
+
+define myfunc_seven(s, d, t) = 7 EUR
+
+;; In order to specific a fixed price, but still valuate that price into the
+;; target commodity, use something like this:
+
+define myfunc_five(s, d, t) = market(5 EUR, d, t)
+
+;; The 'value' directive sets the valuation used for all commodities used in
+;; the rest of the daat stream. This is the fallback, if nothing more
+;; specific is found.
+
+value myfunc_seven
+
+;; You can set a specific valuation function on a per-commodity basis.
+;; Instead of defining a function, you can also pass a lambda.
+
+commodity $
+ value s, d, t -> 6 EUR
+
+;; Each account can also provide a default valuation function for any
+;; commodities transferred to that account.
+
+account Expenses:Food5
+ value myfunc_five
+
+;; The metadata field "Value", if found, overrides the valuation function on a
+;; transaction-wide or per-posting basis.
+
+= @XACT and Food
+ ; Value:: 8 EUR
+ (Equity) $1
+
+= @POST and Dining
+ (Expenses:Food9) $1
+ ; Value:: 9 EUR
+
+;; Lastly, you can specify the valuation function/value for any specific
+;; amount using the (( )) commodity annotation.
+
+2012-03-02 KFC
+ Expenses:Food2 $1 ((2 EUR))
+ Assets:Cash2
+
+2012-03-03 KFC
+ Expenses:Food3 $1
+ ; Value:: 3 EUR
+ Assets:Cash3
+
+2012-03-04 KFC
+ ; Value:: 4 EUR
+ Expenses:Food4 $1
+ Assets:Cash4
+
+2012-03-05 KFC
+ Expenses:Food5 $1
+ Assets:Cash5
+
+2012-03-06 KFC
+ Expenses:Food6 $1
+ Assets:Cash6
+
+2012-03-07 KFC
+ Expenses:Food7 1 CAD
+ Assets:Cas7
+
+2012-03-08 XACT
+ Expenses:Food8 $1
+ Assets:Cash8
+
+2012-03-09 POST
+ Expenses:Dining9 $1
+ Assets:Cash9
+
+test reg -V food
+12-Mar-02 KFC Expenses:Food2 2 EUR 2 EUR
+12-Mar-03 KFC Expenses:Food3 3 EUR 5 EUR
+12-Mar-04 KFC Expenses:Food4 4 EUR 9 EUR
+12-Mar-05 KFC Expenses:Food5 5 EUR 14 EUR
+12-Mar-06 KFC Expenses:Food6 6 EUR 20 EUR
+12-Mar-07 KFC Expenses:Food7 7 EUR 27 EUR
+12-Mar-08 XACT Expenses:Food8 8 EUR 35 EUR
+12-Mar-09 POST (Expenses:Food9) 9 EUR 44 EUR
+end test
diff --git a/test/baseline/feat-value_py.test b/test/baseline/feat-value_py.test
new file mode 100644
index 00000000..5efe315d
--- /dev/null
+++ b/test/baseline/feat-value_py.test
@@ -0,0 +1,23 @@
+python
+ def print_type(val):
+ print type(val), val
+
+eval print_type(true)
+eval print_type([2010/08/10])
+eval print_type(10)
+eval print_type($10.00)
+eval print_type($10.00 + CAD 30)
+eval print_type("Hello!")
+eval print_type(/Hello!/)
+;eval print_type((1, 2, 3))
+
+test reg
+<type 'bool'> True
+<type 'datetime.date'> 2010-08-10
+<class 'ledger.Amount'> 10
+<class 'ledger.Amount'> $10.00
+<class 'ledger.Balance'> $10.00
+CAD 30
+<type 'unicode'> Hello!
+<class 'ledger.Value'> Hello!
+end test
diff --git a/test/baseline/featimport.py b/test/baseline/featimport.py
new file mode 100644
index 00000000..9edd9ba3
--- /dev/null
+++ b/test/baseline/featimport.py
@@ -0,0 +1,4 @@
+import os
+
+def check_path(path_value):
+ return os.path.isfile(str(path_value))
diff --git a/test/baseline/featoption.py b/test/baseline/featoption.py
new file mode 100644
index 00000000..caa4f2bc
--- /dev/null
+++ b/test/baseline/featoption.py
@@ -0,0 +1,5 @@
+def option_pyfirst(context):
+ print "In --pyfirst (from %s)" % context
+
+def option_pysecond(context, val):
+ print "In --pysecond=%sh (from %s)" % (val, context)
diff --git a/test/baseline/opt-auto-match.dat b/test/baseline/opt-auto-match.dat
new file mode 100644
index 00000000..bfbf71eb
--- /dev/null
+++ b/test/baseline/opt-auto-match.dat
@@ -0,0 +1,4 @@
+date,amount,desc,
+2012/03/01,10,Food,
+2012/03/02,10,Phone,
+2012/03/02,10,Dining,
diff --git a/test/baseline/opt-auto-match.test b/test/baseline/opt-auto-match.test
new file mode 100644
index 00000000..7c3fb40a
--- /dev/null
+++ b/test/baseline/opt-auto-match.test
@@ -0,0 +1,30 @@
+2012-01-01 * Opening balance
+ Assets:Cash 100.00 EUR
+ Equity:Opening Balance
+
+2012-01-02 * Food
+ Expenses:Food 25.00 EUR
+ Assets:Cash -25.00 EUR
+
+2012-01-03 * Phone
+ Expenses:Phone 10.00 EUR
+ Assets:Cash -10.00 EUR
+
+2012-01-04 * Dining
+ Expenses:Food 20.00 EUR
+ Liabilities:CC -20.00 EUR
+
+test --input-date-format "%Y-%m-%d" --auto-match convert test/baseline/opt-auto-match.dat
+2012/03/01 * Food
+ Assets:Cash 10
+ Equity:Unknown
+
+2012/03/02 * Phone
+ Assets:Cash 10
+ Equity:Unknown
+
+2012/03/02 * Dining
+ Liabilities:CC 10
+ Equity:Unknown
+end test
+
diff --git a/test/baseline/opt-effective.test b/test/baseline/opt-aux-date.test
index 9d1e73d0..9d1e73d0 100644
--- a/test/baseline/opt-effective.test
+++ b/test/baseline/opt-aux-date.test
diff --git a/test/baseline/opt-bold-if.test b/test/baseline/opt-bold-if.test
index e69de29b..1f6f4c21 100644
--- a/test/baseline/opt-bold-if.test
+++ b/test/baseline/opt-bold-if.test
@@ -0,0 +1,16 @@
+2012-01-01 * Opening balance
+ Assets:Cash 100.00 EUR
+ Equity:Opening Balance
+
+2012-01-02 * Test
+ ; :test:
+ Expenses:Food 100.00 EUR
+ Assets:Cash -100.00 EUR
+
+test reg --bold-if 'has_tag("test")'
+12-Jan-01 Opening balance Assets:Cash 100.00 EUR 100.00 EUR
+ Equity:Opening Balance -100.00 EUR 0
+12-Jan-02 Test  Expenses:Food   100.00 EUR  100.00 EUR
+   Assets:Cash   -100.00 EUR  0
+end test
+
diff --git a/test/baseline/opt-budget-format.test b/test/baseline/opt-budget-format.test
index e69de29b..d2b84f98 100644
--- a/test/baseline/opt-budget-format.test
+++ b/test/baseline/opt-budget-format.test
@@ -0,0 +1,21 @@
+~ Monthly
+ Expenses:Phone 10.00 GBP
+ Expenses:Rent 550.00 GBP
+ Assets
+
+2012-02-28 * Phone expense
+ Expenses:Phone 20.00 GBP
+ Assets:Cash -20.00 GBP
+
+2012-02-29 * Rent expense
+ Expenses:Rent 530.00 GBP
+ Assets:Cash -530.00 GBP
+
+test budget --now 2012-02-29 --budget-format "%(justify(scrub(display_total), 0))\n"
+(-550.00 GBP, 560.00 GBP)
+(550.00 GBP, -560.00 GBP)
+(20.00 GBP, -10.00 GBP)
+(530.00 GBP, -550.00 GBP)
+(0, 0)
+end test
+
diff --git a/test/baseline/opt-check-payees.test b/test/baseline/opt-check-payees.test
new file mode 100644
index 00000000..923729e7
--- /dev/null
+++ b/test/baseline/opt-check-payees.test
@@ -0,0 +1,37 @@
+account Assets:Cash
+account Expenses:Phone
+account Expenses:Rent
+account Expenses:Food
+commodity EUR
+commodity GBP
+payee Phone
+tag food
+
+2012-03-20 Phone
+ Expenses:Phone 20.00 GBP
+ Assets:Cash
+
+2012-03-21 Rent
+ Expenses:Rent 550.00 GBP
+ Assets:Cash
+
+2012-03-22 Food
+ ; :food:
+ Expenses:Food 20.00 EUR
+ Assets:Cash
+
+test bal --explicit --strict --check-payees
+ -20.00 EUR
+ -570.00 GBP Assets:Cash
+ 20.00 EUR
+ 570.00 GBP Expenses
+ 20.00 EUR Food
+ 20.00 GBP Phone
+ 550.00 GBP Rent
+--------------------
+ 0
+__ERROR__
+Warning: "$FILE", line 14: Unknown payee 'Rent'
+Warning: "$FILE", line 18: Unknown payee 'Food'
+end test
+
diff --git a/test/baseline/opt-count.test b/test/baseline/opt-count.test
index e69de29b..9c5495c8 100644
--- a/test/baseline/opt-count.test
+++ b/test/baseline/opt-count.test
@@ -0,0 +1,43 @@
+2012-02-28 Phone expense
+ Expenses:Phone 20.00 GBP
+ Assets:Cash -20.00 GBP
+
+2012-02-29 * Rent expense
+ Expenses:Rent 530.00 GBP
+ Assets:Cash -530.00 GBP
+
+2012-03-03 Phone expense
+ Expenses:Phone 12.00 EUR
+ Assets:Cash -12.00 EUR
+
+2012-03-04 * Bed and breakfast
+ ; Payee: Rent expense
+ ; :bnb:
+ Expenses:Rent 30.00 EUR
+ Assets:Cash -30.00 EUR
+
+test accounts --count
+2 Expenses:Phone
+4 Assets:Cash
+2 Expenses:Rent
+end test
+
+test commodities --count
+4 GBP
+4 EUR
+end test
+
+test payees --count
+4 Phone expense
+4 Rent expense
+end test
+
+test commodities :rent --count
+1 GBP
+1 EUR
+end test
+
+test payees tag bnb --count
+2 Rent expense
+end test
+
diff --git a/test/baseline/opt-day-break.test b/test/baseline/opt-day-break.test
new file mode 100644
index 00000000..18dde546
--- /dev/null
+++ b/test/baseline/opt-day-break.test
@@ -0,0 +1,12 @@
+i 05/10/2011 08:58:37 682
+o 05/12/2011 11:25:21
+
+test reg --base
+11-May-10 (682) 181604s 181604s
+end test
+
+test reg --base --day-break
+11-May-10 (682) 54083s 54083s
+11-May-11 (682) 86400s 140483s
+11-May-12 (682) 41121s 181604s
+end test
diff --git a/test/baseline/opt-dc.test b/test/baseline/opt-dc.test
new file mode 100644
index 00000000..24a564dd
--- /dev/null
+++ b/test/baseline/opt-dc.test
@@ -0,0 +1,16 @@
+2012-03-10 Employer
+ Assets:Cash $100
+ Income:Employer
+
+2012-03-10 KFC
+ Expenses:Food $20
+ Assets:Cash
+
+2012-03-10 KFC - Rebate
+ Assets:Cash
+ Expenses:Food $-5
+
+2012-03-10 KFC - Food & Rebate
+ Expenses:Food $20
+ Expenses:Food $-5
+ Assets:Cash
diff --git a/test/baseline/opt-decimal-comma.test b/test/baseline/opt-decimal-comma.test
index e69de29b..e056c914 100644
--- a/test/baseline/opt-decimal-comma.test
+++ b/test/baseline/opt-decimal-comma.test
@@ -0,0 +1,22 @@
+2012-01-01 * Opening balance
+ Assets:Cash 100,00 EUR
+ Equity:Opening Balance
+
+2012-01-02 * Test
+ Expenses:Food 10,00 EUR
+ Assets:Cash -10,00 EUR
+
+2012-01-03 * Test
+ Expenses:Food €10,00
+ Assets:Cash €-10,00
+
+test --decimal-comma bal
+ 90,00 EUR
+ €-10,00 Assets:Cash
+ -100,00 EUR Equity:Opening Balance
+ 10,00 EUR
+ €10,00 Expenses:Food
+--------------------
+ 0
+end test
+
diff --git a/test/baseline/opt-deviation.test b/test/baseline/opt-deviation.test
index df216b9c..a677ff6e 100644
--- a/test/baseline/opt-deviation.test
+++ b/test/baseline/opt-deviation.test
@@ -190,7 +190,7 @@
Expenses:Books $120.00
Assets:Cash
-test reg --deviation books
+test reg -A --deviation books
08-Jan-01 January Expenses:Books $10.00 0
08-Jan-31 End of January Expenses:Books $10.00 0
08-Feb-01 February Expenses:Books $20.00 $6.67
diff --git a/test/baseline/opt-equity.test b/test/baseline/opt-equity.test
index d8695759..35ea6b1e 100644
--- a/test/baseline/opt-equity.test
+++ b/test/baseline/opt-equity.test
@@ -1,9 +1,58 @@
-2007/02/02 RD VMMXX
- Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
- Income:Dividends:Vanguard:VMMXX $-0.35
+D 1000.00 GBP
+
+2011-03-04 Buy shares
+ Assets:Broker 2 AAA @ 0.90 GBP
+ Assets:Bank
+
+2011-03-05 Buy shares
+ Assets:Broker 2 AAA @ 1.00 GBP
+ Assets:Bank
+
+test equity
+2011/03/05 Opening Balances
+ Assets:Bank -3.80 GBP
+ Assets:Broker 4 AAA
+ Equity:Opening Balances -4 AAA
+ Equity:Opening Balances 3.80 GBP
+end test
test equity assets
-2007/02/02 Opening Balances
- Assets:Investments:Vanguard:VMMXX 0.350 VMMXX
- Equity:Opening Balances -0.350 VMMXX
+2011/03/05 Opening Balances
+ Assets:Bank -3.80 GBP
+ Assets:Broker 4 AAA
+ Equity:Opening Balances -4 AAA
+ Equity:Opening Balances 3.80 GBP
end test
+
+test equity assets:bank
+2011/03/05 Opening Balances
+ Assets:Bank -3.80 GBP
+ Equity:Opening Balances
+end test
+
+test equity assets:broker
+2011/03/05 Opening Balances
+ Assets:Broker 4 AAA
+ Equity:Opening Balances
+end test
+
+test equity --lot-prices
+2011/03/05 Opening Balances
+ Assets:Bank -3.80 GBP
+ Assets:Broker 2 AAA {0.90 GBP}
+ Assets:Broker 2 AAA {1.00 GBP}
+ Equity:Opening Balances -2 AAA {0.90 GBP}
+ Equity:Opening Balances -2 AAA {1.00 GBP}
+ Equity:Opening Balances 3.80 GBP
+end test
+
+test equity --lots
+2011/03/05 Opening Balances
+ Assets:Bank -3.80 GBP
+ Assets:Broker 2 AAA {0.90 GBP} [2011/03/04]
+ Assets:Broker 2 AAA {1.00 GBP} [2011/03/05]
+ Equity:Opening Balances -2 AAA {0.90 GBP} [2011/03/04]
+ Equity:Opening Balances -2 AAA {1.00 GBP} [2011/03/05]
+ Equity:Opening Balances 3.80 GBP
+end test
+
diff --git a/test/baseline/opt-exchange.test b/test/baseline/opt-exchange.test
index cfc48c3f..f5d73f78 100644
--- a/test/baseline/opt-exchange.test
+++ b/test/baseline/opt-exchange.test
@@ -53,6 +53,63 @@ test reg --exchange=' C, A '
Assets:Brokerage -75 A 75 A
09-Jan-01 January 1st, 2009 (3) Assets:Brokerage 100 A 175 A
Assets:Brokerage -100 A 75 A
+09-Jan-02 Commodities revalued <Revalued> 225 A
+ -1800 C 300 A
+ -1800 C
+09-Jan-02 January 2nd, 2009 Assets:Brokerage 500 C 300 A
+ -1300 C
+ Assets:Brokerage -500 C 300 A
+ -1800 C
+09-Jan-03 January 3rd, 2009 Assets:Brokerage 600 C 300 A
+ -1200 C
+ Assets:Brokerage -600 C 300 A
+ -1800 C
+09-Jan-04 January 4th, 2009 Assets:Brokerage 300 A 600 A
+ -1800 C
+ Assets:Brokerage -2400 C 600 A
+ -4200 C
+09-Jan-05 January 5th, 2009 Assets:Brokerage 1280 C 600 A
+ -2920 C
+ Assets:Brokerage -1280 C 600 A
+ -4200 C
+09-Jan-06 Commodities revalued <Revalued> 2040 C 600 A
+ -2160 C
+09-Jan-06 January 6th, 2009 Assets:Brokerage 155 A 755 A
+ -2160 C
+ Assets:Brokerage -186 C 755 A
+ -2346 C
+09-Jan-07 Commodities revalued <Revalued> -86 C 755 A
+ -2432 C
+09-Jan-07 January 7th, 2009 Assets:Brokerage 155 A 910 A
+ -2432 C
+ Assets:Brokerage -200 C 910 A
+ -2632 C
+09-Jan-08 Commodities revalued <Revalued> -5613 C 910 A
+ -8245 C
+09-Jan-08 January 8th, 2009 Assets:Brokerage 155 A 1065 A
+ -8245 C
+ Assets:Brokerage -200 C 1065 A
+ -8445 C
+09-Jan-09 Commodities revalued <Revalued> -2800 C 1065 A
+ -11245 C
+09-Jan-09 January 9th, 2009 Assets:Brokerage 200 C 1065 A
+ -11045 C
+ Assets:Brokerage -155 A 910 A
+ -11045 C
+09-Jan-10 January 10th, 2009 Assets:Brokerage 200 C 910 A
+ -10845 C
+ Assets:Brokerage -155 A 755 A
+ -10845 C
+end test
+
+
+test reg --exchange=' C!, A '
+09-Jan-01 January 1st, 2009 (1) Assets:Brokerage 100 A 100 A
+ Assets:Brokerage -50 A 50 A
+09-Jan-01 January 1st, 2009 (2) Assets:Brokerage 100 A 150 A
+ Assets:Brokerage -75 A 75 A
+09-Jan-01 January 1st, 2009 (3) Assets:Brokerage 100 A 175 A
+ Assets:Brokerage -100 A 75 A
09-Jan-02 Commodities revalued <Revalued> 0 600 C
09-Jan-02 January 2nd, 2009 Assets:Brokerage 500 C 1100 C
Assets:Brokerage -500 C 600 C
diff --git a/test/baseline/opt-explicit.test b/test/baseline/opt-explicit.test
new file mode 100644
index 00000000..defae179
--- /dev/null
+++ b/test/baseline/opt-explicit.test
@@ -0,0 +1,34 @@
+account Assets:Cash
+account Expenses:Phone
+account Expenses:Rent
+commodity GBP
+
+2012-03-20 Phone
+ Expenses:Phone 20.00 GBP
+ Assets:Cash
+
+2012-03-21 Rent
+ Expenses:Rent 550.00 GBP
+ Assets:Cash
+
+2012-03-22 Food
+ ; :food:
+ Expenses:Food 20.00 EUR
+ Assets:Cash
+
+test bal --explicit --strict
+ -20.00 EUR
+ -570.00 GBP Assets:Cash
+ 20.00 EUR
+ 570.00 GBP Expenses
+ 20.00 EUR Food
+ 20.00 GBP Phone
+ 550.00 GBP Rent
+--------------------
+ 0
+__ERROR__
+Warning: "$FILE", line 16: Unknown account 'Expenses:Food'
+Warning: "$FILE", line 16: Unknown commodity 'EUR'
+Warning: "$FILE", line 17: Unknown metadata tag 'food'
+end test
+
diff --git a/test/baseline/opt-file.test b/test/baseline/opt-file.test
new file mode 100644
index 00000000..e01d929d
--- /dev/null
+++ b/test/baseline/opt-file.test
@@ -0,0 +1,12 @@
+test -f opt-file-does-not-exist.dat bal -> 1
+__ERROR__
+Error: Cannot read journal file "opt-file-does-not-exist.dat"
+end test
+
+test -f test/baseline/opt-file1.dat -f test/baseline/opt-file2.dat bal
+ 10 A
+ -10 C
+--------------------
+ 0
+end test
+
diff --git a/test/baseline/opt-file1.dat b/test/baseline/opt-file1.dat
new file mode 100644
index 00000000..394882cd
--- /dev/null
+++ b/test/baseline/opt-file1.dat
@@ -0,0 +1,4 @@
+2012-03-22 * Test 1
+ A 10.00
+ B
+
diff --git a/test/baseline/opt-file2.dat b/test/baseline/opt-file2.dat
new file mode 100644
index 00000000..569993f8
--- /dev/null
+++ b/test/baseline/opt-file2.dat
@@ -0,0 +1,4 @@
+2012-03-22 * Test 2
+ B 10.00
+ C
+
diff --git a/test/baseline/opt-forecast-years.test b/test/baseline/opt-forecast-years.test
index e69de29b..6b1053f5 100644
--- a/test/baseline/opt-forecast-years.test
+++ b/test/baseline/opt-forecast-years.test
@@ -0,0 +1,202 @@
+~ Monthly
+ Expenses:Rent 500.00 GBP
+ Assets
+
+test --now 2012-01-01 --forecast "T<200000.00 GBP" reg :rent
+12-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 500.00 GBP
+12-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 1000.00 GBP
+12-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 1500.00 GBP
+12-May-01 Forecast transaction Expenses:Rent 500.00 GBP 2000.00 GBP
+12-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 2500.00 GBP
+12-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 3000.00 GBP
+12-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 3500.00 GBP
+12-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 4000.00 GBP
+12-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 4500.00 GBP
+12-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 5000.00 GBP
+12-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 5500.00 GBP
+13-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 6000.00 GBP
+13-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 6500.00 GBP
+13-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 7000.00 GBP
+13-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 7500.00 GBP
+13-May-01 Forecast transaction Expenses:Rent 500.00 GBP 8000.00 GBP
+13-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 8500.00 GBP
+13-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 9000.00 GBP
+13-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 9500.00 GBP
+13-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 10000.00 GBP
+13-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 10500.00 GBP
+13-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 11000.00 GBP
+13-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 11500.00 GBP
+14-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 12000.00 GBP
+14-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 12500.00 GBP
+14-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 13000.00 GBP
+14-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 13500.00 GBP
+14-May-01 Forecast transaction Expenses:Rent 500.00 GBP 14000.00 GBP
+14-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 14500.00 GBP
+14-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 15000.00 GBP
+14-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 15500.00 GBP
+14-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 16000.00 GBP
+14-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 16500.00 GBP
+14-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 17000.00 GBP
+14-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 17500.00 GBP
+15-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 18000.00 GBP
+15-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 18500.00 GBP
+15-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 19000.00 GBP
+15-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 19500.00 GBP
+15-May-01 Forecast transaction Expenses:Rent 500.00 GBP 20000.00 GBP
+15-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 20500.00 GBP
+15-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 21000.00 GBP
+15-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 21500.00 GBP
+15-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 22000.00 GBP
+15-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 22500.00 GBP
+15-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 23000.00 GBP
+15-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 23500.00 GBP
+16-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 24000.00 GBP
+16-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 24500.00 GBP
+16-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 25000.00 GBP
+16-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 25500.00 GBP
+16-May-01 Forecast transaction Expenses:Rent 500.00 GBP 26000.00 GBP
+16-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 26500.00 GBP
+16-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 27000.00 GBP
+16-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 27500.00 GBP
+16-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 28000.00 GBP
+16-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 28500.00 GBP
+16-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 29000.00 GBP
+16-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 29500.00 GBP
+end test
+
+test --now 2012-01-01 --forecast-years 1 --forecast "T<200000.00 GBP" reg :rent
+12-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 500.00 GBP
+12-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 1000.00 GBP
+12-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 1500.00 GBP
+12-May-01 Forecast transaction Expenses:Rent 500.00 GBP 2000.00 GBP
+12-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 2500.00 GBP
+12-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 3000.00 GBP
+12-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 3500.00 GBP
+12-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 4000.00 GBP
+12-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 4500.00 GBP
+12-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 5000.00 GBP
+12-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 5500.00 GBP
+end test
+
+test --now 2012-01-01 --forecast-years 10 --forecast "T<200000.00 GBP" reg :rent
+12-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 500.00 GBP
+12-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 1000.00 GBP
+12-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 1500.00 GBP
+12-May-01 Forecast transaction Expenses:Rent 500.00 GBP 2000.00 GBP
+12-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 2500.00 GBP
+12-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 3000.00 GBP
+12-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 3500.00 GBP
+12-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 4000.00 GBP
+12-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 4500.00 GBP
+12-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 5000.00 GBP
+12-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 5500.00 GBP
+13-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 6000.00 GBP
+13-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 6500.00 GBP
+13-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 7000.00 GBP
+13-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 7500.00 GBP
+13-May-01 Forecast transaction Expenses:Rent 500.00 GBP 8000.00 GBP
+13-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 8500.00 GBP
+13-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 9000.00 GBP
+13-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 9500.00 GBP
+13-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 10000.00 GBP
+13-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 10500.00 GBP
+13-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 11000.00 GBP
+13-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 11500.00 GBP
+14-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 12000.00 GBP
+14-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 12500.00 GBP
+14-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 13000.00 GBP
+14-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 13500.00 GBP
+14-May-01 Forecast transaction Expenses:Rent 500.00 GBP 14000.00 GBP
+14-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 14500.00 GBP
+14-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 15000.00 GBP
+14-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 15500.00 GBP
+14-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 16000.00 GBP
+14-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 16500.00 GBP
+14-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 17000.00 GBP
+14-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 17500.00 GBP
+15-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 18000.00 GBP
+15-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 18500.00 GBP
+15-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 19000.00 GBP
+15-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 19500.00 GBP
+15-May-01 Forecast transaction Expenses:Rent 500.00 GBP 20000.00 GBP
+15-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 20500.00 GBP
+15-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 21000.00 GBP
+15-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 21500.00 GBP
+15-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 22000.00 GBP
+15-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 22500.00 GBP
+15-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 23000.00 GBP
+15-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 23500.00 GBP
+16-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 24000.00 GBP
+16-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 24500.00 GBP
+16-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 25000.00 GBP
+16-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 25500.00 GBP
+16-May-01 Forecast transaction Expenses:Rent 500.00 GBP 26000.00 GBP
+16-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 26500.00 GBP
+16-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 27000.00 GBP
+16-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 27500.00 GBP
+16-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 28000.00 GBP
+16-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 28500.00 GBP
+16-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 29000.00 GBP
+16-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 29500.00 GBP
+17-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 30000.00 GBP
+17-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 30500.00 GBP
+17-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 31000.00 GBP
+17-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 31500.00 GBP
+17-May-01 Forecast transaction Expenses:Rent 500.00 GBP 32000.00 GBP
+17-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 32500.00 GBP
+17-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 33000.00 GBP
+17-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 33500.00 GBP
+17-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 34000.00 GBP
+17-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 34500.00 GBP
+17-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 35000.00 GBP
+17-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 35500.00 GBP
+18-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 36000.00 GBP
+18-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 36500.00 GBP
+18-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 37000.00 GBP
+18-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 37500.00 GBP
+18-May-01 Forecast transaction Expenses:Rent 500.00 GBP 38000.00 GBP
+18-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 38500.00 GBP
+18-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 39000.00 GBP
+18-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 39500.00 GBP
+18-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 40000.00 GBP
+18-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 40500.00 GBP
+18-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 41000.00 GBP
+18-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 41500.00 GBP
+19-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 42000.00 GBP
+19-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 42500.00 GBP
+19-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 43000.00 GBP
+19-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 43500.00 GBP
+19-May-01 Forecast transaction Expenses:Rent 500.00 GBP 44000.00 GBP
+19-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 44500.00 GBP
+19-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 45000.00 GBP
+19-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 45500.00 GBP
+19-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 46000.00 GBP
+19-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 46500.00 GBP
+19-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 47000.00 GBP
+19-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 47500.00 GBP
+20-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 48000.00 GBP
+20-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 48500.00 GBP
+20-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 49000.00 GBP
+20-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 49500.00 GBP
+20-May-01 Forecast transaction Expenses:Rent 500.00 GBP 50000.00 GBP
+20-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 50500.00 GBP
+20-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 51000.00 GBP
+20-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 51500.00 GBP
+20-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 52000.00 GBP
+20-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 52500.00 GBP
+20-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 53000.00 GBP
+20-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 53500.00 GBP
+21-Jan-01 Forecast transaction Expenses:Rent 500.00 GBP 54000.00 GBP
+21-Feb-01 Forecast transaction Expenses:Rent 500.00 GBP 54500.00 GBP
+21-Mar-01 Forecast transaction Expenses:Rent 500.00 GBP 55000.00 GBP
+21-Apr-01 Forecast transaction Expenses:Rent 500.00 GBP 55500.00 GBP
+21-May-01 Forecast transaction Expenses:Rent 500.00 GBP 56000.00 GBP
+21-Jun-01 Forecast transaction Expenses:Rent 500.00 GBP 56500.00 GBP
+21-Jul-01 Forecast transaction Expenses:Rent 500.00 GBP 57000.00 GBP
+21-Aug-01 Forecast transaction Expenses:Rent 500.00 GBP 57500.00 GBP
+21-Sep-01 Forecast transaction Expenses:Rent 500.00 GBP 58000.00 GBP
+21-Oct-01 Forecast transaction Expenses:Rent 500.00 GBP 58500.00 GBP
+21-Nov-01 Forecast transaction Expenses:Rent 500.00 GBP 59000.00 GBP
+21-Dec-01 Forecast transaction Expenses:Rent 500.00 GBP 59500.00 GBP
+end test
+
diff --git a/test/baseline/opt-group-by.test b/test/baseline/opt-group-by.test
index e69de29b..1f6c6adf 100644
--- a/test/baseline/opt-group-by.test
+++ b/test/baseline/opt-group-by.test
@@ -0,0 +1,114 @@
+2012-03-20 * Test GBP
+ A -10.00 GBP
+ B
+
+2012-03-20 * Test EUR
+ A -10.00 EUR
+ B
+
+2012-03-22 * Test GBP
+ A -10.00 GBP
+ B
+
+2012-03-22 * Test EUR
+ A -10.00 EUR
+ B
+
+2012-03-25 * Test GBP
+ A -10.00 GBP
+ B
+
+2012-03-25 * Test EUR
+ A -10.00 EUR
+ B
+
+test reg --group-by payee
+Test EUR
+12-Mar-20 Test EUR A -10.00 EUR -10.00 EUR
+ B 10.00 EUR 0
+12-Mar-22 Test EUR A -10.00 EUR -10.00 EUR
+ B 10.00 EUR 0
+12-Mar-25 Test EUR A -10.00 EUR -10.00 EUR
+ B 10.00 EUR 0
+
+Test GBP
+12-Mar-20 Test GBP A -10.00 GBP -10.00 GBP
+ B 10.00 GBP 0
+12-Mar-22 Test GBP A -10.00 GBP -10.00 GBP
+ B 10.00 GBP 0
+12-Mar-25 Test GBP A -10.00 GBP -10.00 GBP
+ B 10.00 GBP 0
+end test
+
+test reg --group-by commodity
+EUR
+12-Mar-20 Test EUR A -10.00 EUR -10.00 EUR
+ B 10.00 EUR 0
+12-Mar-22 Test EUR A -10.00 EUR -10.00 EUR
+ B 10.00 EUR 0
+12-Mar-25 Test EUR A -10.00 EUR -10.00 EUR
+ B 10.00 EUR 0
+
+GBP
+12-Mar-20 Test GBP A -10.00 GBP -10.00 GBP
+ B 10.00 GBP 0
+12-Mar-22 Test GBP A -10.00 GBP -10.00 GBP
+ B 10.00 GBP 0
+12-Mar-25 Test GBP A -10.00 GBP -10.00 GBP
+ B 10.00 GBP 0
+end test
+
+test bal --group-by commodity
+EUR
+ -30.00 EUR A
+ 30.00 EUR B
+--------------------
+ 0
+
+GBP
+ -30.00 GBP A
+ 30.00 GBP B
+--------------------
+ 0
+end test
+
+test bal --group-by payee
+Test EUR
+ -30.00 EUR A
+ 30.00 EUR B
+--------------------
+ 0
+
+Test GBP
+ -30.00 GBP A
+ 30.00 GBP B
+--------------------
+ 0
+end test
+
+test bal --group-by date
+2012/03/20
+ -10.00 EUR
+ -10.00 GBP A
+ 10.00 EUR
+ 10.00 GBP B
+--------------------
+ 0
+
+2012/03/22
+ -10.00 EUR
+ -10.00 GBP A
+ 10.00 EUR
+ 10.00 GBP B
+--------------------
+ 0
+
+2012/03/25
+ -10.00 EUR
+ -10.00 GBP A
+ 10.00 EUR
+ 10.00 GBP B
+--------------------
+ 0
+end test
+
diff --git a/test/baseline/opt-group-title-format.test b/test/baseline/opt-group-title-format.test
index e69de29b..a2a1a984 100644
--- a/test/baseline/opt-group-title-format.test
+++ b/test/baseline/opt-group-title-format.test
@@ -0,0 +1,48 @@
+2012-03-20 * Test GBP
+ A -10.00 GBP
+ B
+
+2012-03-20 * Test EUR
+ A -10.00 EUR
+ B
+
+2012-03-22 * Test GBP
+ A -10.00 GBP
+ B
+
+2012-03-22 * Test EUR
+ A -10.00 EUR
+ B
+
+test bal --group-by payee --group-title-format "-%(value)-\n"
+-Test EUR-
+ -20.00 EUR A
+ 20.00 EUR B
+--------------------
+ 0
+
+-Test GBP-
+ -20.00 GBP A
+ 20.00 GBP B
+--------------------
+ 0
+end test
+
+test bal --group-by date --group-title-format "|%(value)|\n"
+|2012/03/20|
+ -10.00 EUR
+ -10.00 GBP A
+ 10.00 EUR
+ 10.00 GBP B
+--------------------
+ 0
+
+|2012/03/22|
+ -10.00 EUR
+ -10.00 GBP A
+ 10.00 EUR
+ 10.00 GBP B
+--------------------
+ 0
+end test
+
diff --git a/test/baseline/opt-historical.test b/test/baseline/opt-historical.test
new file mode 100644
index 00000000..9eb3558b
--- /dev/null
+++ b/test/baseline/opt-historical.test
@@ -0,0 +1,250 @@
+D EUR 2.000,00
+
+P 2011-12-15 $ EUR 2
+P 2011-12-15 AAPL $5.00
+
+2012-01-01 Broker
+ Assets:Stocks 10 AAPL {$1} @ $10
+ Equity
+
+P 2012-01-15 AAPL $15.00
+
+2012-02-02 Broker
+ Assets:Stocks 10 AAPL {$2} @ $20
+ Equity
+
+P 2012-02-15 AAPL $25.00
+
+2012-03-03 Broker
+ Assets:Stocks 10 AAPL {$3} @ $30
+ Equity
+
+P 2012-03-15 AAPL $35.00
+
+2012-04-04 Broker
+ Assets:Stocks 10 AAPL {$4} @ $40
+ Equity
+
+P 2012-04-15 AAPL $45.00
+
+2012-05-05 Broker
+ Assets:Stocks 10 AAPL {$5} @ $50
+ Equity
+
+P 2012-5-15 AAPL $55.00
+
+test reg stocks
+12-Jan-01 Broker Assets:Stocks 10 AAPL 10 AAPL
+12-Feb-02 Broker Assets:Stocks 10 AAPL 20 AAPL
+12-Mar-03 Broker Assets:Stocks 10 AAPL 30 AAPL
+12-Apr-04 Broker Assets:Stocks 10 AAPL 40 AAPL
+12-May-05 Broker Assets:Stocks 10 AAPL 50 AAPL
+end test
+
+test reg stocks -O
+12-Jan-01 Broker Assets:Stocks 10 AAPL 10 AAPL
+12-Feb-02 Broker Assets:Stocks 10 AAPL 20 AAPL
+12-Mar-03 Broker Assets:Stocks 10 AAPL 30 AAPL
+12-Apr-04 Broker Assets:Stocks 10 AAPL 40 AAPL
+12-May-05 Broker Assets:Stocks 10 AAPL 50 AAPL
+end test
+
+test reg stocks -B
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Feb-02 Broker Assets:Stocks $200 $300
+12-Mar-03 Broker Assets:Stocks $300 $600
+12-Apr-04 Broker Assets:Stocks $400 $1000
+12-May-05 Broker Assets:Stocks $500 $1500
+end test
+
+test reg stocks -I
+12-Jan-01 Broker Assets:Stocks $10 $10
+12-Feb-02 Broker Assets:Stocks $20 $30
+12-Mar-03 Broker Assets:Stocks $30 $60
+12-Apr-04 Broker Assets:Stocks $40 $100
+12-May-05 Broker Assets:Stocks $50 $150
+end test
+
+test reg stocks -V
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Jan-15 Commodities revalued <Revalued> $50 $150
+12-Feb-02 Commodities revalued <Revalued> $50 $200
+12-Feb-02 Broker Assets:Stocks $200 $400
+12-Feb-15 Commodities revalued <Revalued> $100 $500
+12-Mar-03 Commodities revalued <Revalued> $100 $600
+12-Mar-03 Broker Assets:Stocks $300 $900
+12-Mar-15 Commodities revalued <Revalued> $150 $1050
+12-Apr-04 Commodities revalued <Revalued> $150 $1200
+12-Apr-04 Broker Assets:Stocks $400 $1600
+12-Apr-15 Commodities revalued <Revalued> $200 $1800
+12-May-05 Commodities revalued <Revalued> $200 $2000
+12-May-05 Broker Assets:Stocks $500 $2500
+end test
+
+test reg stocks -O -V
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Jan-15 Commodities revalued <Revalued> $50 $150
+12-Feb-02 Commodities revalued <Revalued> $50 $200
+12-Feb-02 Broker Assets:Stocks $200 $400
+12-Feb-15 Commodities revalued <Revalued> $100 $500
+12-Mar-03 Commodities revalued <Revalued> $100 $600
+12-Mar-03 Broker Assets:Stocks $300 $900
+12-Mar-15 Commodities revalued <Revalued> $150 $1050
+12-Apr-04 Commodities revalued <Revalued> $150 $1200
+12-Apr-04 Broker Assets:Stocks $400 $1600
+12-Apr-15 Commodities revalued <Revalued> $200 $1800
+12-May-05 Commodities revalued <Revalued> $200 $2000
+12-May-05 Broker Assets:Stocks $500 $2500
+end test
+
+test reg stocks -B -V
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Feb-02 Broker Assets:Stocks $200 $300
+12-Mar-03 Broker Assets:Stocks $300 $600
+12-Apr-04 Broker Assets:Stocks $400 $1000
+12-May-05 Broker Assets:Stocks $500 $1500
+end test
+
+test reg stocks -I -V
+12-Jan-01 Broker Assets:Stocks $10 $10
+12-Feb-02 Broker Assets:Stocks $20 $30
+12-Mar-03 Broker Assets:Stocks $30 $60
+12-Apr-04 Broker Assets:Stocks $40 $100
+12-May-05 Broker Assets:Stocks $50 $150
+end test
+
+test reg stocks -X EUR
+12-Jan-01 Broker Assets:Stocks EUR 200,00 EUR 200,00
+12-Feb-02 Commodities revalued <Revalued> EUR 200,00 EUR 400,00
+12-Feb-02 Broker Assets:Stocks EUR 400,00 EUR 800,00
+12-Mar-03 Commodities revalued <Revalued> EUR 400,00 EUR 1.200,00
+12-Mar-03 Broker Assets:Stocks EUR 600,00 EUR 1.800,00
+12-Apr-04 Commodities revalued <Revalued> EUR 600,00 EUR 2.400,00
+12-Apr-04 Broker Assets:Stocks EUR 800,00 EUR 3.200,00
+12-May-05 Commodities revalued <Revalued> EUR 800,00 EUR 4.000,00
+12-May-05 Broker Assets:Stocks EUR 1.000,00 EUR 5.000,00
+end test
+
+test reg stocks -O -X EUR
+12-Jan-01 Broker Assets:Stocks EUR 200,00 EUR 200,00
+12-Feb-02 Commodities revalued <Revalued> EUR 200,00 EUR 400,00
+12-Feb-02 Broker Assets:Stocks EUR 400,00 EUR 800,00
+12-Mar-03 Commodities revalued <Revalued> EUR 400,00 EUR 1.200,00
+12-Mar-03 Broker Assets:Stocks EUR 600,00 EUR 1.800,00
+12-Apr-04 Commodities revalued <Revalued> EUR 600,00 EUR 2.400,00
+12-Apr-04 Broker Assets:Stocks EUR 800,00 EUR 3.200,00
+12-May-05 Commodities revalued <Revalued> EUR 800,00 EUR 4.000,00
+12-May-05 Broker Assets:Stocks EUR 1.000,00 EUR 5.000,00
+end test
+
+test reg stocks -B -X EUR
+12-Jan-01 Broker Assets:Stocks EUR 200,00 EUR 200,00
+12-Feb-02 Broker Assets:Stocks EUR 400,00 EUR 600,00
+12-Mar-03 Broker Assets:Stocks EUR 600,00 EUR 1.200,00
+12-Apr-04 Broker Assets:Stocks EUR 800,00 EUR 2.000,00
+12-May-05 Broker Assets:Stocks EUR 1.000,00 EUR 3.000,00
+end test
+
+test reg stocks -I -X EUR
+12-Jan-01 Broker Assets:Stocks EUR 20,00 EUR 20,00
+12-Feb-02 Broker Assets:Stocks EUR 40,00 EUR 60,00
+12-Mar-03 Broker Assets:Stocks EUR 60,00 EUR 120,00
+12-Apr-04 Broker Assets:Stocks EUR 80,00 EUR 200,00
+12-May-05 Broker Assets:Stocks EUR 100,00 EUR 300,00
+end test
+
+test reg stocks -H
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Feb-02 Broker Assets:Stocks $200 $300
+12-Mar-03 Broker Assets:Stocks $300 $600
+12-Apr-04 Broker Assets:Stocks $400 $1000
+12-May-05 Broker Assets:Stocks $500 $1500
+end test
+
+test reg stocks -O -H
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Feb-02 Broker Assets:Stocks $200 $300
+12-Mar-03 Broker Assets:Stocks $300 $600
+12-Apr-04 Broker Assets:Stocks $400 $1000
+12-May-05 Broker Assets:Stocks $500 $1500
+end test
+
+test reg stocks -B -H
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Feb-02 Broker Assets:Stocks $200 $300
+12-Mar-03 Broker Assets:Stocks $300 $600
+12-Apr-04 Broker Assets:Stocks $400 $1000
+12-May-05 Broker Assets:Stocks $500 $1500
+end test
+
+test reg stocks -I -H
+12-Jan-01 Broker Assets:Stocks $10 $10
+12-Feb-02 Broker Assets:Stocks $20 $30
+12-Mar-03 Broker Assets:Stocks $30 $60
+12-Apr-04 Broker Assets:Stocks $40 $100
+12-May-05 Broker Assets:Stocks $50 $150
+end test
+
+test reg stocks -H -V
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Feb-02 Broker Assets:Stocks $200 $300
+12-Mar-03 Broker Assets:Stocks $300 $600
+12-Apr-04 Broker Assets:Stocks $400 $1000
+12-May-05 Broker Assets:Stocks $500 $1500
+end test
+
+test reg stocks -O -H -V
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Feb-02 Broker Assets:Stocks $200 $300
+12-Mar-03 Broker Assets:Stocks $300 $600
+12-Apr-04 Broker Assets:Stocks $400 $1000
+12-May-05 Broker Assets:Stocks $500 $1500
+end test
+
+test reg stocks -B -H -V
+12-Jan-01 Broker Assets:Stocks $100 $100
+12-Feb-02 Broker Assets:Stocks $200 $300
+12-Mar-03 Broker Assets:Stocks $300 $600
+12-Apr-04 Broker Assets:Stocks $400 $1000
+12-May-05 Broker Assets:Stocks $500 $1500
+end test
+
+test reg stocks -I -H -V
+12-Jan-01 Broker Assets:Stocks $10 $10
+12-Feb-02 Broker Assets:Stocks $20 $30
+12-Mar-03 Broker Assets:Stocks $30 $60
+12-Apr-04 Broker Assets:Stocks $40 $100
+12-May-05 Broker Assets:Stocks $50 $150
+end test
+
+test reg stocks -H -X EUR
+12-Jan-01 Broker Assets:Stocks EUR 200,00 EUR 200,00
+12-Feb-02 Broker Assets:Stocks EUR 400,00 EUR 600,00
+12-Mar-03 Broker Assets:Stocks EUR 600,00 EUR 1.200,00
+12-Apr-04 Broker Assets:Stocks EUR 800,00 EUR 2.000,00
+12-May-05 Broker Assets:Stocks EUR 1.000,00 EUR 3.000,00
+end test
+
+test reg stocks -O -H -X EUR
+12-Jan-01 Broker Assets:Stocks EUR 200,00 EUR 200,00
+12-Feb-02 Broker Assets:Stocks EUR 400,00 EUR 600,00
+12-Mar-03 Broker Assets:Stocks EUR 600,00 EUR 1.200,00
+12-Apr-04 Broker Assets:Stocks EUR 800,00 EUR 2.000,00
+12-May-05 Broker Assets:Stocks EUR 1.000,00 EUR 3.000,00
+end test
+
+test reg stocks -B -H -X EUR
+12-Jan-01 Broker Assets:Stocks EUR 200,00 EUR 200,00
+12-Feb-02 Broker Assets:Stocks EUR 400,00 EUR 600,00
+12-Mar-03 Broker Assets:Stocks EUR 600,00 EUR 1.200,00
+12-Apr-04 Broker Assets:Stocks EUR 800,00 EUR 2.000,00
+12-May-05 Broker Assets:Stocks EUR 1.000,00 EUR 3.000,00
+end test
+
+test reg stocks -I -H -X EUR
+12-Jan-01 Broker Assets:Stocks EUR 20,00 EUR 20,00
+12-Feb-02 Broker Assets:Stocks EUR 40,00 EUR 60,00
+12-Mar-03 Broker Assets:Stocks EUR 60,00 EUR 120,00
+12-Apr-04 Broker Assets:Stocks EUR 80,00 EUR 200,00
+12-May-05 Broker Assets:Stocks EUR 100,00 EUR 300,00
+end test
diff --git a/test/baseline/opt-actual-dates.test b/test/baseline/opt-immediate.test
index e69de29b..e69de29b 100644
--- a/test/baseline/opt-actual-dates.test
+++ b/test/baseline/opt-immediate.test
diff --git a/test/baseline/opt-inject.test b/test/baseline/opt-inject.test
index e69de29b..685cf12c 100644
--- a/test/baseline/opt-inject.test
+++ b/test/baseline/opt-inject.test
@@ -0,0 +1,10 @@
+2012-03-20 * Test GBP
+ ; Expected:: -15.00 GBP
+ Expenses:Phone 20.00 GBP
+ Assets:Cash
+
+test --inject Expected reg Expenses:Phone
+12-Mar-20 Test GBP Expected -15.00 GBP -15.00 GBP
+12-Mar-20 Test GBP Expenses:Phone 20.00 GBP 5.00 GBP
+end test
+
diff --git a/test/baseline/opt-lot-notes.test b/test/baseline/opt-lot-notes.test
new file mode 100644
index 00000000..3bfa9e45
--- /dev/null
+++ b/test/baseline/opt-lot-notes.test
@@ -0,0 +1,31 @@
+2012-01-01 * Opening balance
+ Assets:Cash 100.00 GBP
+ Equity:Opening Balance
+
+2012-01-02 * Voucher 1
+ Assets:Voucher 10.00 GBP (aaaa)
+ Assets:Cash -10.00 GBP
+
+2012-01-03 * Voucher 1
+ Assets:Voucher 10.00 GBP (bbbb)
+ Assets:Cash -10.00 GBP
+
+2012-01-04 * Voucher 1
+ Assets:Voucher 10.00 GBP (cccc)
+ Assets:Cash -10.00 GBP
+
+test bal assets:voucher --lot-notes
+ 10.00 GBP (aaaa)
+ 10.00 GBP (bbbb)
+ 10.00 GBP (cccc) Assets:Voucher
+end test
+
+test reg assets:voucher --lot-notes
+12-Jan-02 Voucher 1 Assets:Voucher 10.00 GBP (aaaa) 10.00 GBP (aaaa)
+12-Jan-03 Voucher 1 Assets:Voucher 10.00 GBP (bbbb) 10.00 GBP (aaaa)
+ 10.00 GBP (bbbb)
+12-Jan-04 Voucher 1 Assets:Voucher 10.00 GBP (cccc) 10.00 GBP (aaaa)
+ 10.00 GBP (bbbb)
+ 10.00 GBP (cccc)
+end test
+
diff --git a/test/baseline/opt-meta-width.test b/test/baseline/opt-meta-width.test
index ce751e24..893e175b 100644
--- a/test/baseline/opt-meta-width.test
+++ b/test/baseline/opt-meta-width.test
@@ -9,6 +9,6 @@
; :AnotherTag:
test reg --meta Sample --meta-width=15
-Another Value 04-May-27 Credit card com.. Liab:MasterCard $20.00 $20.00
-Value As:Ban:Checking $-20.00 0
+Another Value 04-May-27 Credit card co.. Liabi:MasterCard $20.00 $20.00
+Value As:Bank:Checking $-20.00 0
end test
diff --git a/test/baseline/opt-no-pager.test b/test/baseline/opt-no-pager.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-no-pager.test
diff --git a/test/baseline/opt-payee-as-account.test b/test/baseline/opt-payee-as-account.test
index 113a395b..0d1f87d6 100644
--- a/test/baseline/opt-payee-as-account.test
+++ b/test/baseline/opt-payee-as-account.test
@@ -21,11 +21,11 @@
test reg --account=payee
08-Jan-01 January January:Expenses:Books $10.00 $10.00
08-Jan-01 January January:Assets:Cash $-10.00 0
-08-Jan-31 End of January End of :Expenses:Books $10.00 $10.00
+08-Jan-31 End of January End of:Expenses:Books $10.00 $10.00
08-Jan-31 End of January End of Jan:Assets:Cash $-10.00 0
08-Feb-01 February Februar:Expenses:Books $20.00 $20.00
08-Feb-01 February February:Assets:Cash $-20.00 0
-08-Feb-28 End of February End of :Expenses:Books $20.00 $20.00
+08-Feb-28 End of February End of:Expenses:Books $20.00 $20.00
08-Feb-28 End of February End of Feb:Assets:Cash $-20.00 0
08-Mar-01 March March:Expenses:Books $30.00 $30.00
08-Mar-01 March March:Assets:Cash $-30.00 0
diff --git a/test/baseline/opt-pedantic.test b/test/baseline/opt-pedantic.test
new file mode 100644
index 00000000..fbb27b84
--- /dev/null
+++ b/test/baseline/opt-pedantic.test
@@ -0,0 +1,17 @@
+2012-03-20 Test GBP
+ Expenses:Phone 20.00 GBP
+ Assets:Cash
+
+2012-03-21 * Test GBP
+ Expenses:Phone 20.00 GBP
+ Assets:Cash
+
+test bal --pedantic -> 1
+__ERROR__
+While parsing file "$FILE", line 2:
+While parsing posting:
+ Expenses:Phone 20.00 GBP
+
+Error: Unknown account 'Expenses:Phone'
+end test
+
diff --git a/test/baseline/opt-period.test b/test/baseline/opt-period.test
index 7268bcce..f370b404 100644
--- a/test/baseline/opt-period.test
+++ b/test/baseline/opt-period.test
@@ -257,7 +257,7 @@ test reg -p "weekly january 2008"
08-Jan-01 - 08-Jan-05 Assets:Cash $-20.00 $-20.00
Expenses:Books $10.00 $-10.00
Liabilities:Cards $10.00 0
-08-Jan-29 - 08-Jan-31 Assets:Cash $-20.00 $-20.00
+08-Jan-27 - 08-Jan-31 Assets:Cash $-20.00 $-20.00
Expenses:Books $10.00 $-10.00
Liabilities:Cards $10.00 0
end test
diff --git a/test/baseline/opt-permissive.test b/test/baseline/opt-permissive.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-permissive.test
diff --git a/test/baseline/opt-primary-date.test b/test/baseline/opt-primary-date.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-primary-date.test
diff --git a/test/baseline/opt-rich-data.test b/test/baseline/opt-rich-data.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-rich-data.test
diff --git a/test/baseline/opt-time-report.test b/test/baseline/opt-time-report.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-time-report.test
diff --git a/test/baseline/opt-unround.test b/test/baseline/opt-unround.test
index cef212ae..755bb62c 100644
--- a/test/baseline/opt-unround.test
+++ b/test/baseline/opt-unround.test
@@ -82,7 +82,7 @@
Expenses:Travel:Passport $127.00
Assets:Checking
-test bal --unround --percent
+test bal --percent --unround
100.00% Assets:Checking
100.00% Expenses:Travel
92.14958953% Airfare
diff --git a/test/baseline/opt-value-expr.test b/test/baseline/opt-value-expr.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-value-expr.test
diff --git a/test/baseline/opt-verify-memory.test b/test/baseline/opt-verify-memory.test
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/test/baseline/opt-verify-memory.test