summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/baseline/cmd-balance.test85
-rw-r--r--test/baseline/cmd-cleared.test36
-rw-r--r--test/baseline/cmd-csv.test53
-rw-r--r--test/baseline/cmd-emacs.test18
-rw-r--r--test/baseline/cmd-pricedb.test39
-rw-r--r--test/baseline/cmd-prices.test39
6 files changed, 270 insertions, 0 deletions
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-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-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-emacs.test b/test/baseline/cmd-emacs.test
new file mode 100644
index 00000000..0d4addad
--- /dev/null
+++ b/test/baseline/cmd-emacs.test
@@ -0,0 +1,18 @@
+
+2012-03-23 * Test
+ A 10.00
+ B
+
+2012-03-23 * (100) Code
+ A 10.00 EUR
+ B
+
+test emacs
+(("$sourcepath/test/baseline/cmd-emacs.test" 2 (20331 48384 0) nil "Test"
+ (3 "A" "10" t)
+ (4 "B" "-10" t))
+ ("$sourcepath/test/baseline/cmd-emacs.test" 6 (20331 48384 0) "100" "Code"
+ (7 "A" "10.00 EUR" t)
+ (8 "B" "-10.00 EUR" t)))
+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-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
+