diff options
Diffstat (limited to 'test/baseline')
22 files changed, 346 insertions, 12 deletions
diff --git a/test/baseline/cmd-cleared.test b/test/baseline/cmd-cleared.test index 501d207f..91219a40 100644 --- a/test/baseline/cmd-cleared.test +++ b/test/baseline/cmd-cleared.test @@ -30,7 +30,7 @@ test cleared -20 0 F -30 -30 12-Feb-26 G -40 0 H ----------------- ---------------- --------- +---------------- ---------------- --------- 0 0 end test 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-auto-match.test b/test/baseline/opt-auto-match.test index 7c3fb40a..54a1053b 100644 --- a/test/baseline/opt-auto-match.test +++ b/test/baseline/opt-auto-match.test @@ -14,17 +14,58 @@ Expenses:Food 20.00 EUR Liabilities:CC -20.00 EUR +test --input-date-format "%Y-%m-%d" convert test/baseline/opt-auto-match.dat +2012/03/01 * Food + Expenses:Unknown 10 + Equity:Unknown + +2012/03/02 * Phone + Expenses:Unknown 10 + Equity:Unknown + +2012/03/02 * Dining + Expenses:Unknown 10 + Equity:Unknown +end test + test --input-date-format "%Y-%m-%d" --auto-match convert test/baseline/opt-auto-match.dat 2012/03/01 * Food - Assets:Cash 10 + Expenses:Food 10 Equity:Unknown 2012/03/02 * Phone - Assets:Cash 10 + Expenses:Phone 10 Equity:Unknown 2012/03/02 * Dining - Liabilities:CC 10 + Expenses:Food 10 Equity:Unknown end test +test --input-date-format "%Y-%m-%d" --account Assets:Bank convert test/baseline/opt-auto-match.dat +2012/03/01 * Food + Expenses:Unknown 10 + Assets:Bank + +2012/03/02 * Phone + Expenses:Unknown 10 + Assets:Bank + +2012/03/02 * Dining + Expenses:Unknown 10 + Assets:Bank +end test + +test --input-date-format "%Y-%m-%d" --auto-match --account Assets:Bank convert test/baseline/opt-auto-match.dat +2012/03/01 * Food + Expenses:Food 10 + Assets:Bank + +2012/03/02 * Phone + Expenses:Phone 10 + Assets:Bank + +2012/03/02 * Dining + Expenses:Food 10 + Assets:Bank +end test 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-init-file.dat b/test/baseline/opt-init-file.dat new file mode 100644 index 00000000..92c5307a --- /dev/null +++ b/test/baseline/opt-init-file.dat @@ -0,0 +1 @@ +--decimal-comma diff --git a/test/baseline/opt-init-file.test b/test/baseline/opt-init-file.test new file mode 100644 index 00000000..128814e1 --- /dev/null +++ b/test/baseline/opt-init-file.test @@ -0,0 +1,10 @@ +2012-03-17 Quick + Expenses:Food 12,50 € + Assets:Cash + +test --init-file test/baseline/opt-init-file.dat bal + -12,50 € Assets:Cash + 12,50 € Expenses:Food +-------------------- + 0 +end test 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-no-titles.test b/test/baseline/opt-no-titles.test index e69de29b..40a9b421 100644 --- a/test/baseline/opt-no-titles.test +++ b/test/baseline/opt-no-titles.test @@ -0,0 +1,10 @@ +test reg -f test/input/drewr3.dat --no-titles --group-by payee reg food +11-Jan-02 Grocery Store Expense:Food:Groceries $ 65.00 $ 65.00 +11-Jan-19 Grocery Store Expense:Food:Groceries $ 44.00 $ 109.00 +10-Dec-20 Organic Co-op Expense:Food:Groceries $ 37.50 $ 37.50 + Expense:Food:Groceries $ 37.50 $ 75.00 + Expense:Food:Groceries $ 37.50 $ 112.50 + Expense:Food:Groceries $ 37.50 $ 150.00 + Expense:Food:Groceries $ 37.50 $ 187.50 + Expense:Food:Groceries $ 37.50 $ 225.00 +end test diff --git a/test/baseline/opt-permissive.test b/test/baseline/opt-permissive.test index e69de29b..8f8ff031 100644 --- a/test/baseline/opt-permissive.test +++ b/test/baseline/opt-permissive.test @@ -0,0 +1,19 @@ + +; The option --permissive quiets balance assertions + +2014-05-01 * Opening balance + Assets:Cash $100 + Equity:Opening balance + +2014-05-10 * Spend money + Expenses:Foo $10 + Assets:Cash -$10 = $80 + +test bal --permissive + $90 Assets:Cash + $-100 Equity:Opening balance + $10 Expenses:Foo +-------------------- + 0 +end test + diff --git a/test/baseline/opt-price-db.dat b/test/baseline/opt-price-db.dat new file mode 100644 index 00000000..abc51a0a --- /dev/null +++ b/test/baseline/opt-price-db.dat @@ -0,0 +1,2 @@ +P 2012-03-16 06:47:12 CAD $2.50 +P 2012-03-17 06:47:12 CAD $3.50 diff --git a/test/baseline/opt-price-db.test b/test/baseline/opt-price-db.test new file mode 100644 index 00000000..06021e4a --- /dev/null +++ b/test/baseline/opt-price-db.test @@ -0,0 +1,8 @@ +2012-03-17 KFC + Expenses:Food 20 CAD + Assets:Cash + +test pricedb --price-db test/baseline/opt-price-db.dat +P 2012/03/16 06:47:12 CAD $2.5 +P 2012/03/17 06:47:12 CAD $3.5 +end test diff --git a/test/baseline/opt-rich-data.test b/test/baseline/opt-rich-data.test index fbb73ebe..265af531 100644 --- a/test/baseline/opt-rich-data.test +++ b/test/baseline/opt-rich-data.test @@ -1,3 +1,13 @@ +test -f /dev/null convert test/baseline/feat-convert-with-directives.dat --now '2014/08/01' +2012/01/01 * KFC + Expenses:Unknown $10 + Equity:Unknown + +2012/01/02 * REWE SAGT DANKE 123454321 + Expenses:Unknown 10€ + Equity:Unknown +end test + test -f /dev/null convert test/baseline/feat-convert-with-directives.dat --detail --now '2014/08/01' 2012/01/01 * KFC ; CSV: 2012/01/01,KFC,$10 diff --git a/test/baseline/opt-script.dat b/test/baseline/opt-script.dat new file mode 100644 index 00000000..ac6085d5 --- /dev/null +++ b/test/baseline/opt-script.dat @@ -0,0 +1,3 @@ +--no-pager --columns=80 bal +--no-pager --columns=80 reg +--no-pager --columns=80 print diff --git a/test/baseline/opt-script.test b/test/baseline/opt-script.test new file mode 100644 index 00000000..041c15ee --- /dev/null +++ b/test/baseline/opt-script.test @@ -0,0 +1,15 @@ +2012-03-17 KFC + Expenses:Food 20 CAD + Assets:Cash + +test --script test/baseline/opt-script.dat + -20 CAD Assets:Cash + 20 CAD Expenses:Food +-------------------- + 0 +12-Mar-17 KFC Expenses:Food 20 CAD 20 CAD + Assets:Cash -20 CAD 0 +2012/03/17 KFC + Expenses:Food 20 CAD + Assets:Cash +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-values.test b/test/baseline/opt-values.test new file mode 100644 index 00000000..35eeeaf6 --- /dev/null +++ b/test/baseline/opt-values.test @@ -0,0 +1,6 @@ +test tags -f test/input/drewr3.dat --values +hastag: not block +hastag: true +nestedtag: true +nobudget +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 |