summaryrefslogtreecommitdiff
path: root/test/baseline
diff options
context:
space:
mode:
Diffstat (limited to 'test/baseline')
-rw-r--r--test/baseline/cmd-convert.test (renamed from test/baseline/cmd-convert.test.disable)4
-rw-r--r--test/baseline/opt-cleared-format.test20
-rw-r--r--test/baseline/opt-explicit.test14
-rw-r--r--test/baseline/opt-file.test (renamed from test/baseline/opt-file.test.disable)0
-rw-r--r--test/baseline/opt-generated.test0
-rw-r--r--test/baseline/opt-no-pager.test0
-rw-r--r--test/baseline/opt-no-revalued.test58
-rw-r--r--test/baseline/opt-no-rounding.test81
-rw-r--r--test/baseline/opt-value-expr.test48
-rw-r--r--test/baseline/opt-verify-memory.test0
10 files changed, 217 insertions, 8 deletions
diff --git a/test/baseline/cmd-convert.test.disable b/test/baseline/cmd-convert.test
index d444da52..8ee5bb2e 100644
--- a/test/baseline/cmd-convert.test.disable
+++ b/test/baseline/cmd-convert.test
@@ -17,7 +17,7 @@ end test
test -f /dev/null --input-date-format "%m/%d/%Y" convert test/baseline/cmd-convert3.dat -> 1
__ERROR__
-While parsing file "$sourcepath/test/baseline/cmd-convert3.dat", line 1:
+While parsing file "$sourcepath/test/baseline/cmd-convert3.dat", line 1:
While parsing CSV line:
01/01/2011,,
@@ -26,7 +26,7 @@ end test
test -f /dev/null convert test/baseline/cmd-convert4.dat -> 1
__ERROR__
-While parsing file "$sourcepath/test/baseline/cmd-convert4.dat", line 1:
+While parsing file "$sourcepath/test/baseline/cmd-convert4.dat", line 1:
While parsing CSV line:
bogus,$10,
diff --git a/test/baseline/opt-cleared-format.test b/test/baseline/opt-cleared-format.test
index e69de29b..4d3ea267 100644
--- a/test/baseline/opt-cleared-format.test
+++ b/test/baseline/opt-cleared-format.test
@@ -0,0 +1,20 @@
+test cleared --file test/input/drewr3.dat --cleared-format "%-30(account) %15(get_at(total_expr, 0)) %15(get_at(total_expr, 1))\n%/"
+Assets $ -3,804.00 $ 775.00
+Assets:Checking $ 1,396.00 $ 775.00
+Assets:Checking:Business $ 30.00 0
+Assets:Savings $ -5,200.00 0
+Equity:Opening Balances $ -1,000.00 $ -1,000.00
+Expenses $ 6,654.00 $ 225.00
+Expenses:Auto $ 5,500.00 0
+Expenses:Books $ 20.00 0
+Expenses:Escrow $ 300.00 0
+Expenses:Food:Groceries $ 334.00 $ 225.00
+Expenses:Interest:Mortgage $ 500.00 0
+Income $ -2,030.00 0
+Income:Salary $ -2,000.00 0
+Income:Sales $ -30.00 0
+Liabilities $ -63.60 0
+Liabilities:MasterCard $ -20.00 0
+Liabilities:Mortgage:Principal $ 200.00 0
+Liabilities:Tithe $ -243.60 0
+end test
diff --git a/test/baseline/opt-explicit.test b/test/baseline/opt-explicit.test
index defae179..20b74913 100644
--- a/test/baseline/opt-explicit.test
+++ b/test/baseline/opt-explicit.test
@@ -2,16 +2,18 @@ account Assets:Cash
account Expenses:Phone
account Expenses:Rent
commodity GBP
+tag bar
-2012-03-20 Phone
+2012-03-20 * Phone
+ ; :bar:
Expenses:Phone 20.00 GBP
Assets:Cash
-2012-03-21 Rent
+2012-03-21 * Rent
Expenses:Rent 550.00 GBP
Assets:Cash
-2012-03-22 Food
+2012-03-22 * Food
; :food:
Expenses:Food 20.00 EUR
Assets:Cash
@@ -27,8 +29,8 @@ test bal --explicit --strict
--------------------
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'
+Warning: "$FILE", line 18: Unknown account 'Expenses:Food'
+Warning: "$FILE", line 18: Unknown commodity 'EUR'
+Warning: "$FILE", line 19: Unknown metadata tag 'food'
end test
diff --git a/test/baseline/opt-file.test.disable b/test/baseline/opt-file.test
index 66d0ab1b..66d0ab1b 100644
--- a/test/baseline/opt-file.test.disable
+++ b/test/baseline/opt-file.test
diff --git a/test/baseline/opt-generated.test b/test/baseline/opt-generated.test
deleted file mode 100644
index e69de29b..00000000
--- a/test/baseline/opt-generated.test
+++ /dev/null
diff --git a/test/baseline/opt-no-pager.test b/test/baseline/opt-no-pager.test
deleted file mode 100644
index e69de29b..00000000
--- a/test/baseline/opt-no-pager.test
+++ /dev/null
diff --git a/test/baseline/opt-no-revalued.test b/test/baseline/opt-no-revalued.test
new file mode 100644
index 00000000..487ffa30
--- /dev/null
+++ b/test/baseline/opt-no-revalued.test
@@ -0,0 +1,58 @@
+2009/01/01 Sample 1a
+ Assets:Brokerage:Stocks 100 S
+ Assets:Brokerage:Cash -100 P
+
+P 2009/01/01 00:00:00 S 2 P
+
+2009/02/01 Sample 2a
+ Assets:Brokerage:Stocks 100 S @ 1 P
+ Assets:Brokerage:Cash
+
+P 2009/02/01 00:00:00 S 4 P
+
+2009/03/01 Sample 3a
+ Assets:Brokerage:Stocks 100 S @@ 100 P
+ Assets:Brokerage:Cash
+
+P 2009/03/01 00:00:00 S 8 P
+
+2009/04/01 Sample 4a
+ Assets:Brokerage:Cash 100 P
+ Assets:Brokerage:Stocks -100 S {1 P}
+
+P 2009/04/01 00:00:00 S 16 P
+
+; In this usage case, the top amount is always secondary
+; 2010/01/01 Sample 1b
+; Assets:Brokerage:Cash -100 P
+; Assets:Brokerage:Stocks 100 S
+;
+; P 2010/01/01 00:00:00 S 2 P
+
+2010/02/01 Sample 2b
+ Assets:Brokerage:Cash
+ Assets:Brokerage:Stocks 100 S @ 1 P
+
+P 2010/02/01 00:00:00 S 4 P
+
+2010/03/01 Sample 3b
+ Assets:Brokerage:Cash
+ Assets:Brokerage:Stocks 100 S @@ 100 P
+
+P 2010/03/01 00:00:00 S 8 P
+
+2010/04/01 Sample 4b
+ Assets:Brokerage:Stocks -100 S {1 P}
+ Assets:Brokerage:Cash 100 P
+
+P 2010/04/01 00:00:00 S 16 P
+
+test reg --market --no-revalued stocks
+09-Jan-01 Sample 1a Asset:Brokerage:Stocks 200 P 200 P
+09-Feb-01 Sample 2a Asset:Brokerage:Stocks 400 P 800 P
+09-Mar-01 Sample 3a Asset:Brokerage:Stocks 800 P 2400 P
+09-Apr-01 Sample 4a Asset:Brokerage:Stocks -1600 P 3200 P
+10-Feb-01 Sample 2b Asset:Brokerage:Stocks 400 P 1200 P
+10-Mar-01 Sample 3b Asset:Brokerage:Stocks 800 P 3200 P
+10-Apr-01 Sample 4b Asset:Brokerage:Stocks -1600 P 4800 P
+end test
diff --git a/test/baseline/opt-no-rounding.test b/test/baseline/opt-no-rounding.test
index e69de29b..5d0758c6 100644
--- a/test/baseline/opt-no-rounding.test
+++ b/test/baseline/opt-no-rounding.test
@@ -0,0 +1,81 @@
+2012-01-01 * Opening balance
+ Assets:Current 17.43 EUR
+ Assets:Investments 200 "LU02" @ 24.77 EUR
+ Assets:Investments 58 "LU02" @ 24.79900855 EUR
+ Equity:Opening balance
+
+2012-01-01 * Opening balance
+ Assets:Pension 785.44 GBP
+ Assets:Pension 97.0017 "H2" @ 5.342999720204 GBP
+ Assets:Pension 4.3441 "H1" @ 5.289999915108 GBP
+ Equity:Opening balance
+
+2012-01-01 * Opening balance: misc
+ Assets:Piggy bank 3.51 GBP
+ Equity:Opening balance
+
+2012-01-01 * Opening balance
+ Assets:Rewards 9836 AAdvantage
+ Equity:Opening balance
+
+2012-01-03 * Receivable
+ Assets:Current
+ Assets:Receivable -161.06 EUR
+ Assets:Receivable -9.99 GBP @@ 11.65 EUR
+
+2012-01-27 * Test
+ Income:Test -2759.50 GBP
+ Income:Test -110.76 GBP
+ Assets:Foo 345.57 GBP
+ Expenses:Test 16.47 GBP
+ Expenses:Test 6.33 GBP
+ Expenses:Test 261.39 GBP
+ Assets:Current
+
+test reg -X EUR -H --no-rounding
+12-Jan-01 Opening balance Assets:Current 17.43 EUR 17.43 EUR
+ Assets:Investments 4959.80 EUR 4977.23 EUR
+ Assets:Investments 1438.34 EUR 6415.57 EUR
+ Equity:Opening balance -6409.77 EUR 5.80 EUR
+12-Jan-01 Opening balance Assets:Pension 785.44 GBP 5.80 EUR
+ 785.44 GBP
+ Assets:Pension 97.0017 H2 5.80 EUR
+ 785.44 GBP
+ 97.0017 H2
+ Assets:Pension 4.3441 H1 5.80 EUR
+ 785.44 GBP
+ 4.3441 H1
+ 97.0017 H2
+ Equity:Opening balance -1326.70 GBP 5.80 EUR
+ -541.26 GBP
+ 4.3441 H1
+ 97.0017 H2
+12-Jan-01 Opening balance: misc Assets:Piggy bank 3.51 GBP 5.80 EUR
+ -537.75 GBP
+ 4.3441 H1
+ 97.0017 H2
+ Equity:Opening balance -3.51 GBP 5.80 EUR
+ -541.26 GBP
+ 4.3441 H1
+ 97.0017 H2
+12-Jan-01 Opening balance Assets:Rewards 9836 AAdvantage 9836 AAdvantage
+ 5.80 EUR
+ -541.26 GBP
+ 4.3441 H1
+ 97.0017 H2
+ Equity:Opening balance -9836 AAdvantage 5.80 EUR
+ -541.26 GBP
+ 4.3441 H1
+ 97.0017 H2
+12-Jan-03 Commodities revalued <Revalued> 0 5.80 EUR
+12-Jan-03 Receivable Assets:Current 172.71 EUR 178.51 EUR
+ Assets:Receivable -161.06 EUR 17.45 EUR
+ Assets:Receivable -11.65 EUR 5.80 EUR
+12-Jan-27 Test Income:Test -3218.04 EUR -3212.23 EUR
+ Income:Test -129.16 EUR -3341.40 EUR
+ Assets:Foo 402.99 EUR -2938.41 EUR
+ Expenses:Test 19.21 EUR -2919.20 EUR
+ Expenses:Test 7.38 EUR -2911.82 EUR
+ Expenses:Test 304.82 EUR -2606.99 EUR
+ Assets:Current 2612.80 EUR 5.80 EUR
+end test
diff --git a/test/baseline/opt-value-expr.test b/test/baseline/opt-value-expr.test
index e69de29b..8b68a80e 100644
--- a/test/baseline/opt-value-expr.test
+++ b/test/baseline/opt-value-expr.test
@@ -0,0 +1,48 @@
+
+D 1000.00 EUR
+D 1000.00 USD
+D 1000.00 DM
+
+2015-01-01 * Buy 2 FOO
+ Assets:Investments 2 FOO @@ 20.00 EUR
+ Assets:Cash -20.00 EUR
+
+2015-05-01 * Spend on food
+ Expenses:Food 20.00 USD
+ ; Just to be silly, always valuate *these* $20 as 30 DM, no matter what
+ ; the user asks for with -V or -X
+ ; VALUE:: 30 DM
+ Assets:Cash -20.00 USD
+
+P 2015-05-01 USD 20 DM
+
+P 2015-06-01 USD 22 DM
+
+test bal assets:investments -V --value-expr "25.00 EUR"
+ 50.00 EUR Assets:Investments
+end test
+
+test bal assets:investments -G --value-expr "date < [March 2015] ? 22.00 EUR : 25.00 EUR" --now "2015-02-20"
+ 24.00 EUR Assets:Investments
+end test
+
+test bal assets:investments -G --value-expr "date < [March 2015] ? 22.00 EUR : 25.00 EUR" --now "2015-03-20"
+ 30.00 EUR Assets:Investments
+end test
+
+test bal expenses:food
+ 20.00 USD Expenses:Food
+end test
+
+test bal expenses:food -V
+ 600.00 DM Expenses:Food
+end test
+
+test bal expenses:food -X "DM" --now "2015-05-02"
+ 600.00 DM Expenses:Food
+end test
+
+test bal expenses:food -X "DM" --now "2015-06-02"
+ 600.00 DM Expenses:Food
+end test
+
diff --git a/test/baseline/opt-verify-memory.test b/test/baseline/opt-verify-memory.test
deleted file mode 100644
index e69de29b..00000000
--- a/test/baseline/opt-verify-memory.test
+++ /dev/null