diff options
author | John Wiegley <johnw@newartisans.com> | 2012-04-26 16:39:25 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2012-04-26 16:39:25 -0500 |
commit | 64a9b42381c26baf24e58b40f50f0b253e551811 (patch) | |
tree | 5447a29dff64c3a8b7be8100a01bcb4a2d73b0bb /test/regress | |
parent | 7cc550fc22357e2ded194d3e65287c6b3317f5ae (diff) | |
parent | b4407c10c0071365322b2963747bf42a57fd7304 (diff) | |
download | fork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.tar.gz fork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.tar.bz2 fork-ledger-64a9b42381c26baf24e58b40f50f0b253e551811.zip |
Merge branch 'release/v3.0.0-20120426'
Diffstat (limited to 'test/regress')
67 files changed, 2025 insertions, 9 deletions
diff --git a/test/regress/012ADB60.test b/test/regress/012ADB60.test new file mode 100644 index 00000000..443b9e5b --- /dev/null +++ b/test/regress/012ADB60.test @@ -0,0 +1,24 @@ +2005/01/03 * Pay Credit card + Liabilities:CredCard $1,000.00 ; Electronic/ACH Debit + Assets:Current:Checking ; Electronic/ACH Debit + (Virtualaccount) $1,000.00 + +2006/01/03 Gift shop + Expenses:Gifts $46.50 + * Liabilities:CredCard + +2006/01/03 Bike shop + Expenses:Misc $199.00 + * Liabilities:CredCard + (testvirtual) $184.72 + +2006/01/04 Store + Expenses:Misc $49.95 + * Liabilities:CredCard + +test equity -e 2006 +2005/01/03 Opening Balances + Assets:Current:Checking $-1,000.00 + Liabilities:CredCard $1,000.00 + (Virtualaccount) $1,000.00 +end test diff --git a/test/regress/10D19C11.test b/test/regress/10D19C11.test new file mode 100644 index 00000000..be0469ad --- /dev/null +++ b/test/regress/10D19C11.test @@ -0,0 +1,37 @@ +; Test for: ./ledger -f doc/sample.dat -E bal liab' shows the Assets account + += /^Expenses:Books/ + (Liabilities:Taxes) -0.10 + +~ Monthly + Assets:Bank:Checking $500.00 + Income:Salary + +2004/05/01 * Checking balance + Assets:Bank:Checking $1,000.00 + Equity:Opening Balances + +2004/05/01 * Investment balance + Assets:Brokerage 50 AAPL @ $30.00 + Equity:Opening Balances + +2004/05/14 * Pay day + Assets:Bank:Checking $500.00 + Income:Salary + +2004/05/27 Book Store + Expenses:Books $20.00 + Liabilities:MasterCard + +2004/05/27 (100) Credit card company + Liabilities:MasterCard $20.00 + Assets:Bank:Checking + +test -E bal liabilities + $-2.00 Liabilities + 0 MasterCard + $-2.00 Taxes +-------------------- + $-2.00 +end test + diff --git a/test/regress/1384C1D8.test b/test/regress/1384C1D8.test new file mode 100644 index 00000000..77a07b7a --- /dev/null +++ b/test/regress/1384C1D8.test @@ -0,0 +1,27 @@ +@alias OLD1 = NEW1 + +2012-01-01 Something + OLD1 $10.00 + Other + +!alias OLD2 = NEW2 + +2012-01-01 Something + OLD2 $10.00 + Other + +account NEW3 + alias OLD3 + +2012-01-01 Something + OLD3 $10.00 + Other + +test bal + $10.00 NEW1 + $10.00 NEW2 + $10.00 NEW3 + $-30.00 Other +-------------------- + 0 +end test diff --git a/test/regress/14DB77E7.test b/test/regress/14DB77E7.test new file mode 100644 index 00000000..4d8734f9 --- /dev/null +++ b/test/regress/14DB77E7.test @@ -0,0 +1,18 @@ +D 1000.00 GBP + +;P 2011-01-01 EUR 0.8604 GBP +P 2011-02-01 EUR 0.8576 GBP + +2011-01-31 * AdSense earnings + Assets:Receivable:AdSense 11.00 EUR + Income:AdSense + +2011-02-28 * AdSense earnings + Assets:Receivable:AdSense 10.00 EUR + Income:AdSense + +test reg income:adse -X GBP -H +11-Jan-31 AdSense earnings Income:AdSense -11.00 EUR -11.00 EUR +11-Feb-28 Commodities revalued <Revalued> -9.43 GBP -9.43 GBP +11-Feb-28 AdSense earnings Income:AdSense -8.58 GBP -18.01 GBP +end test diff --git a/test/regress/15A80F68.test b/test/regress/15A80F68.test new file mode 100644 index 00000000..0b29b82d --- /dev/null +++ b/test/regress/15A80F68.test @@ -0,0 +1,15 @@ +; Test for: Confusing error message with ledger v3 with invalid input + +2008/03/03 + A (2 FOO @ 10.00 EUR) = 20.00 EUR + B + +test bal -> 1 +__ERROR__ +While parsing file "$FILE", line 4: +While parsing posting: + A (2 FOO @ 10.00 EUR) = 20.00 EUR + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Error: Invalid char '@' +end test + diff --git a/test/regress/178501DC.test b/test/regress/178501DC.test new file mode 100644 index 00000000..b5319ac8 --- /dev/null +++ b/test/regress/178501DC.test @@ -0,0 +1,21 @@ +; Test for: The bal report does not honor -r (ledger bal simon +; would show all accounts, rather than just simon and the related +; account). + +2011/10/26 trader joe's + simon $-50 + alice $-50 + expenses:food:groceries + +test bal -r simon + $-50 alice + $100 expenses:food:groceries +-------------------- + $50 +end test + +test reg -r simon +11-Oct-26 trader joe's alice $-50 $-50 + expense:food:groceries $100 $50 +end test + diff --git a/test/regress/1A546C4D.test b/test/regress/1A546C4D.test new file mode 100644 index 00000000..97adc9de --- /dev/null +++ b/test/regress/1A546C4D.test @@ -0,0 +1,13 @@ +2012/02/22 * Testing invalid amount + Assets:Cash $1,00.00 + Equity:Opening Balances + +test bal -> 1 +__ERROR__ +While parsing file "$FILE", line 2: +While parsing posting: + Assets:Cash $1,00.00 + ^^^^^^^^ +Error: Incorrect use of thousand-mark comma +end test + diff --git a/test/regress/1E192DF6.test b/test/regress/1E192DF6.test new file mode 100644 index 00000000..7d0f8182 --- /dev/null +++ b/test/regress/1E192DF6.test @@ -0,0 +1,57 @@ +; -*- ledger -*- +D 1000,00 PLN +N $ +N h +N PLN +N zł +C 1,00 PLN = 1,00 + +2010-05-19 * ŁUKASZ STELMACH + Assets:Checking:Konto24 GBP 200,00 GBP @ 4,8799 PLN ; fikimiki + Assets:Checking:Konto<30 -975,98 PLN + +2010-05-19 * ŁUKASZ STELMACH + Assets:Checking:Konto24 GBP 200,00 GBP @ 4,8799 PLN ; fikimiki + Assets:Checking:Konto<30 -975,98 PLN + +2010-05-19 * ŁUKASZ STELMACH + Assets:Checking:Konto<30 -975,98 PLN @ 0,204922 GBP + Assets:Checking:Konto24 GBP 200,00 GBP ; fikimiki + +2010-05-19 * ŁUKASZ STELMACH + Assets:Checking:Konto<30 -975,98 PLN @ 0,204922 GBP + Assets:Checking:Konto24 GBP 200,00 GBP ; fikimiki + +2010-05-19 * ŁUKASZ STELMACH + Assets:Checking:Konto24 GBP 200,00 GBP @ 4,8799 PLN ; fikimiki + Assets:Checking:Konto<30 -975,98 PLN + +2010-05-19 * ŁUKASZ STELMACH + Assets:Checking:Konto24 GBP 200,00 GBP @ 4,8799 PLN ; fikimiki + Assets:Checking:Konto<30 -975,98 PLN + +test reg +10-May-19 ŁUKASZ STELMACH As:Checkin:Konto24 GBP 200,00 GBP 200,00 GBP + Asse:Checking:Konto<30 -975.98 -975.98 + 200,00 GBP +10-May-19 ŁUKASZ STELMACH As:Checkin:Konto24 GBP 200,00 GBP -975.98 + 400,00 GBP + Asse:Checking:Konto<30 -975.98 -1951.96 + 400,00 GBP +10-May-19 ŁUKASZ STELMACH Asse:Checking:Konto<30 -975.98 -2927.94 + 400,00 GBP + As:Checkin:Konto24 GBP 200,00 GBP -2927.94 + 600,00 GBP +10-May-19 ŁUKASZ STELMACH Asse:Checking:Konto<30 -975.98 -3903.92 + 600,00 GBP + As:Checkin:Konto24 GBP 200,00 GBP -3903.92 + 800,00 GBP +10-May-19 ŁUKASZ STELMACH As:Checkin:Konto24 GBP 200,00 GBP -3903.92 + 1000,00 GBP + Asse:Checking:Konto<30 -975.98 -4879.9 + 1000,00 GBP +10-May-19 ŁUKASZ STELMACH As:Checkin:Konto24 GBP 200,00 GBP -4879.9 + 1200,00 GBP + Asse:Checking:Konto<30 -975.98 -5855.88 + 1200,00 GBP +end test diff --git a/test/regress/25A099C9.test b/test/regress/25A099C9.test index fc06449b..1ef5ebef 100644 --- a/test/regress/25A099C9.test +++ b/test/regress/25A099C9.test @@ -1,17 +1,43 @@ -test -f $sourcepath/src/amount.h reg -> 7 +test -f src/amount.h reg -> 20 __ERROR__ -While parsing file "$sourcepath/src/amount.h", line 66: +While parsing file "src/amount.h", line 2: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 33: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 37: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 66: Error: No quantity specified for amount -While parsing file "$sourcepath/src/amount.h", line 726: +While parsing file "src/amount.h", line 69: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 83: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 93: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 99: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 121: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 132: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 702: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 732: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 740: +Error: Unexpected whitespace at beginning of line +While parsing file "src/amount.h", line 743: Error: Invalid date/time: line amount_t amoun -While parsing file "$sourcepath/src/amount.h", line 732: +While parsing file "src/amount.h", line 749: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 738: +While parsing file "src/amount.h", line 755: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 744: +While parsing file "src/amount.h", line 761: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 750: +While parsing file "src/amount.h", line 767: Error: Invalid date/time: line std::ostream& -While parsing file "$sourcepath/src/amount.h", line 757: +While parsing file "src/amount.h", line 774: Error: Invalid date/time: line std::istream& +While parsing file "src/amount.h", line 780: +Error: Unexpected whitespace at beginning of line end test diff --git a/test/regress/2CE7DADB.test b/test/regress/2CE7DADB.test new file mode 100644 index 00000000..c6d94b96 --- /dev/null +++ b/test/regress/2CE7DADB.test @@ -0,0 +1,13 @@ +2012-01-01 * Buy AAA + A 1 AAA @ 1.00 EUR + B -1.00 EUR + +2012-02-01 * Buy AAA + A 1 AAA @ 2.00 EUR + B -2.00 EUR + +test --anon pricedb --format "%(date) %(amount)\n" +2012/01/01 1.00 A +2012/02/01 2.00 A +end test + diff --git a/test/regress/3AAB00ED.test b/test/regress/3AAB00ED.test new file mode 100644 index 00000000..217917b3 --- /dev/null +++ b/test/regress/3AAB00ED.test @@ -0,0 +1,23 @@ +; Test for: --sort d not working with -p + +2009-01-01 Opening Balances + Assets:Checking 100.00 EUR + Equity:Opening Balances + +2009-03-01 Test + Expenses:Phone 10.00 EUR + Assets:Checking + +2009-02-01 Test + Expenses:Phone 10.00 EUR + Assets:Checking + +test --sort d -p "until 2010" reg +09-Jan-01 Opening Balances Assets:Checking 100.00 EUR 100.00 EUR + Equit:Opening Balances -100.00 EUR 0 +09-Feb-01 Test Expenses:Phone 10.00 EUR 10.00 EUR + Assets:Checking -10.00 EUR 0 +09-Mar-01 Test Expenses:Phone 10.00 EUR 10.00 EUR + Assets:Checking -10.00 EUR 0 +end test + diff --git a/test/regress/3FE26304.test b/test/regress/3FE26304.test new file mode 100644 index 00000000..7c5b6026 --- /dev/null +++ b/test/regress/3FE26304.test @@ -0,0 +1,74 @@ +N $ +P 2010/09/28 20:43:24 E $3.700 +P 2010/09/28 20:43:25 A $5.230 +P 2010/09/28 20:43:26 D $34.020 +P 2010/09/28 20:43:27 C $12.370 +P 2010/09/28 20:43:28 F $39.700 +P 2010/09/28 20:43:29 B $39.430 +P 2010/09/29 13:50:15 E $3.720 +P 2010/09/29 13:50:15 A $5.240 +P 2010/09/29 13:50:17 D $33.920 +P 2010/09/29 13:50:18 C $12.310 P 2010/09/29 13:50:18 F $39.670 +P 2010/09/29 13:50:19 B $39.830 + +2010/04/04 * Opening Balance + Assets:Sub1 100 A @ $0.01 + Equity:Opening Balances + +2010/04/04 * Opening Balance + Assets:Sub1 100 B @ $32.27 + Equity:Opening Balances + +2010/04/04 * Opening Balance + Assets:Sub1 100 C @ $11.30 + Equity:Opening Balances + +2010/04/04 * Opening Balance + Assets:Sub1 100 D @ $20.30 + Equity:Opening Balances + +2010/04/04 * Opening Balance + Assets:Sub1:Leftovers $6.79 + Equity:Opening Balances + +2010/04/04 * Opening Balance + Assets:Sub1 11 D + Equity:Opening Balances + +2010/04/04 * Opening Balance + Assets:Sub1 100 E @ $2.97 + Equity:Opening Balances + +2010/05/18=2010/05/21 * FOO + Assets:Sub1 200 F @ $27.190 + Expenses:Qux $29.95 + Assets:Sub2 + +2010/07/02 * BAR + Income:D -$169.65 + Assets:Sub2 $32.50 + Assets:Sub1 6 D @ $22.64 + Assets:Sub1:Leftovers + +test bal -X \$ sub1 + $18026.74 Assets:Sub1 + $8.10 Leftovers +-------------------- + $18026.74 +end test + +test reg -X \$ sub1 --now=2012/03/14 +10-Apr-04 Opening Balance Assets:Sub1 $1.00 $1.00 +10-Apr-04 Opening Balance Assets:Sub1 $3227.00 $3228.00 +10-Apr-04 Opening Balance Assets:Sub1 $1130.00 $4358.00 +10-Apr-04 Opening Balance Assets:Sub1 $2030.00 $6388.00 +10-Apr-04 Opening Balance Assets:Sub1:Leftovers $6.79 $6394.79 +10-Apr-04 Opening Balance Assets:Sub1 $223.30 $6618.09 +10-Apr-04 Opening Balance Assets:Sub1 $297.00 $6915.09 +10-May-18 FOO Assets:Sub1 $5438.00 $12353.09 +10-Jul-02 Commodities revalued <Revalued> $259.74 $12612.83 +10-Jul-02 BAR Assets:Sub1 $135.84 $12748.67 + Assets:Sub1:Leftovers $1.31 $12749.98 +10-Sep-29 Commodities revalued <Revalued> $5251.46 $18001.44 +12-Mar-14 Commodities revalued <Revalued> $25.30 $18026.74 +end test diff --git a/test/regress/4509F714.test b/test/regress/4509F714.test new file mode 100644 index 00000000..5c5985f2 --- /dev/null +++ b/test/regress/4509F714.test @@ -0,0 +1,25 @@ +P 2008/01/01 $ €1 + +2008/01/11 LIAT + Expenses:Travel:Airfare $40.00 + Liabilities:MasterCard + +2008/02/05 CTX + Expenses:Travel:Auto €240.38 + Liabilities:MasterCard + +test bal --exchange=€ + €280.38 Expenses:Travel + €40.00 Airfare + €240.38 Auto + €-280.38 Liabilities:MasterCard +-------------------- + 0 +end test + +test bal --exchange=€ --percent + 100.00% Expenses:Travel + 14.27% Airfare + 85.73% Auto + 100.00% Liabilities:MasterCard +end test diff --git a/test/regress/47C579B8.test b/test/regress/47C579B8.test new file mode 100644 index 00000000..f1f9579f --- /dev/null +++ b/test/regress/47C579B8.test @@ -0,0 +1,92 @@ +2008/01/11 LIAT + Expenses:Travel:Airfare 40,00 € + Liabilities:MasterCard + +2008/01/14 cheaptickets.com + Expenses:Travel:Airfare 182,19 € + Liabilities:MasterCard + +2008/02/05 CTX + Expenses:Travel:Auto 240,38 € + Liabilities:MasterCard + +2008/02/05 UNITED + Expenses:Travel:Airfare 238,80 € + Liabilities:MasterCard + +2008/02/05 UNITED + Expenses:Travel:Airfare 238,80 € + Liabilities:MasterCard + +2008/02/22 BUDGET RENT-A-CAR + Expenses:Travel:Auto 40,59 € + Liabilities:MasterCard + +2008/03/16 IBERIA + Expenses:Travel:Airfare 1231,60 € + Liabilities:MasterCard + +2008/03/16 IBERIA + Expenses:Travel:Airfare 1231,60 € + Liabilities:MasterCard + +2008/04/03 AMERICAN + Expenses:Travel:Airfare 155,86 € + Liabilities:MasterCard + +2008/04/03 AMERICAN + Expenses:Travel:Airfare 155,86 € + Liabilities:MasterCard + +2008/04/30 UNITED + Expenses:Travel:Airfare 437,21 € + Liabilities:MasterCard + +2008/04/30 UNITED + Expenses:Travel:Airfare 437,21 € + Liabilities:MasterCard + +2008/08/08 BCIS I-131 FILING FEE- + Expenses:Travel:Passport 170,00 € + Liabilities:MasterCard + +2008/09/06 AMERICAN + Expenses:Travel:Airfare 912,60 € + Liabilities:MasterCard + +2008/09/06 AMERICAN + Expenses:Travel:Airfare 912,60 € + Liabilities:MasterCard + +2008/09/22 AGNT FEE + Expenses:Travel:Airfare 70,00 € + Liabilities:MasterCard + +2008/09/22 DELTA + Expenses:Travel:Airfare 806,20 € + Liabilities:MasterCard + +2008/09/22 DELTA + Expenses:Travel:Airfare 806,20 € + Liabilities:MasterCard + +2008/09/22 LIAT 1974 LIMITED + Expenses:Travel:Airfare 418,34 € + Liabilities:MasterCard + +2008/12/26 U.S. Department of State + Expenses:Travel:Passport 127,00 € + Assets:Checking + +2008/12/26 U.S. Department of State + Expenses:Travel:Passport 127,00 € + Assets:Checking + +test --decimal-comma --percent balance + 100.00% Assets:Checking + 100.00% Expenses:Travel + 92.15% Airfare + 3.13% Auto + 4.72% Passport + 100.00% Liabilities:MasterCard +end test diff --git a/test/regress/4D9288AE.dat b/test/regress/4D9288AE.dat new file mode 100644 index 00000000..758feb19 --- /dev/null +++ b/test/regress/4D9288AE.dat @@ -0,0 +1,4 @@ +2012-03-17 Payee + Expenses:Food $20 + Assets:Cash + diff --git a/test/regress/4D9288AE.py b/test/regress/4D9288AE.py new file mode 100644 index 00000000..4f9c9ba9 --- /dev/null +++ b/test/regress/4D9288AE.py @@ -0,0 +1,4 @@ +import ledger + +for post in ledger.read_journal("test/regress/4D9288AE.dat").query("^expenses:"): + print post.cost diff --git a/test/regress/4D9288AE_py.test b/test/regress/4D9288AE_py.test new file mode 100644 index 00000000..ff2874ce --- /dev/null +++ b/test/regress/4D9288AE_py.test @@ -0,0 +1,3 @@ +test python test/regress/4D9288AE.py +None +end test diff --git a/test/regress/53BCED29.test b/test/regress/53BCED29.test new file mode 100644 index 00000000..77fd39f3 --- /dev/null +++ b/test/regress/53BCED29.test @@ -0,0 +1,29 @@ +D $1,000.00 + +; payroll taxes += /^Payroll/ + Liabilities:Taxes:CFICA 0.062 + Liabilities:Taxes:CMED 0.0145 + $account:EFICA -0.062 + $account:EMED -0.0145 + +; Hourly rates for each employee, as commodity prices. +P 2010/01/01 EONE $15.00 + +; Payroll transactions +2010/05/18 Payroll from May 2nd to May 15th for Employee1 + Assets:Checking 20 EONE + Payroll:Employee1 + +test bal -V + $300.00 Assets:Checking + $-22.95 Liabilities:Taxes + $-18.60 CFICA + $-4.35 CMED + $-277.05 Payroll:Employee1 + $18.60 EFICA + $4.35 EMED +-------------------- + 0 +end test + diff --git a/test/regress/5D92A5EB.test b/test/regress/5D92A5EB.test new file mode 100644 index 00000000..1bdd7256 --- /dev/null +++ b/test/regress/5D92A5EB.test @@ -0,0 +1,34 @@ +~ Monthly from 2010/7/1 + Expenses:Auto:Gas $100.00 + Expenses:Auto:Insurance $100.00 + Expenses:Childcare $100.00 + Expenses:Entertainment:Blizzard $100.00 + Expenses:Entertainment:Netflix $100.00 + Expenses:Groceries $100.00 + Expenses:Utilities:Electric $100.00 + Expenses:Utilities:Water $100.00 + Expenses:Utilities:Sewage $100.00 + Liabilities:Education:ULL $100.00 + Liabilities:Mortgage $100.00 + Assets:Bank:Checking + +test -J reg checking -> 1 +__ERROR__ +While parsing file "$FILE", line 13: +While parsing periodic transaction: +> ~ Monthly from 2010/7/1 +> Expenses:Auto:Gas $100.00 +> Expenses:Auto:Insurance $100.00 +> Expenses:Childcare $100.00 +> Expenses:Entertainment:Blizzard $100.00 +> Expenses:Entertainment:Netflix $100.00 +> Expenses:Groceries $100.00 +> Expenses:Utilities:Electric $100.00 +> Expenses:Utilities:Water $100.00 +> Expenses:Utilities:Sewage $100.00 +> Liabilities:Education:ULL $100.00 +> Liabilities:Mortgage $100.00 +> Assets:Bank:Checking +Error: Posting with null amount's account may be mispelled: + "Expenses:Entertainment:Blizzard $100.00" +end test diff --git a/test/regress/605A410D.test b/test/regress/605A410D.test new file mode 100644 index 00000000..6943939a --- /dev/null +++ b/test/regress/605A410D.test @@ -0,0 +1,32 @@ += expr amount > 500 and account =~ /Employer:One/ + (Virtual) 1 + +2012-01-16 KFC + Employer:One $1,000.00 + Assets:Cash + += expr amount>500 and account =~ /Employer:Two/ + (Virtual) 10 + +2012-02-16 KFC + Employer:Two $1,000.00 + Assets:Cash + += Employer:Three and expr amount>500 + (Virtual) 100 + +2012-03-16 KFC + Employer:Three $1,000.00 + Assets:Cash + +test reg +12-Jan-16 KFC Employer:One $1,000.00 $1,000.00 + Assets:Cash $-1,000.00 0 + (Virtual) $1,000.00 $1,000.00 +12-Feb-16 KFC Employer:Two $1,000.00 $2,000.00 + Assets:Cash $-1,000.00 $1,000.00 + (Virtual) $10,000.00 $11,000.00 +12-Mar-16 KFC Employer:Three $1,000.00 $12,000.00 + Assets:Cash $-1,000.00 $11,000.00 + (Virtual) $100,000.00 $111,000.00 +end test diff --git a/test/regress/6188B0EC.test b/test/regress/6188B0EC.test new file mode 100644 index 00000000..b2aec910 --- /dev/null +++ b/test/regress/6188B0EC.test @@ -0,0 +1,10 @@ +; Test for: No error message if the parser cannot find an included file + +!include 6188B0EC-does-not-exist.dat + +test bal -> 1 +__ERROR__ +While parsing file "$FILE", line 3: +Error: File to include was not found: "$sourcepath/test/regress/6188B0EC-does-not-exist.dat" +end test + diff --git a/test/regress/640D3205.test b/test/regress/640D3205.test new file mode 100644 index 00000000..f43b850f --- /dev/null +++ b/test/regress/640D3205.test @@ -0,0 +1,20 @@ +; Test for: "print" command filters out the "balance assertions" + +2008/12/31 * Interest + Assets:Brokerage $800.00 + Income:Somewhere + +2008/12/31 * Interest + Assets:Brokerage $200.00 = $1,000.00 + Income:Somewhere + +test print +2008/12/31 * Interest + Assets:Brokerage $800.00 + Income:Somewhere + +2008/12/31 * Interest + Assets:Brokerage $200.00 = $1000.00 + Income:Somewhere +end test + diff --git a/test/regress/65FECA4D.test b/test/regress/65FECA4D.test new file mode 100644 index 00000000..3e575961 --- /dev/null +++ b/test/regress/65FECA4D.test @@ -0,0 +1,12 @@ +--now=2012-02-28 + +Y 2012 + +2/29 E-trade Bank + Expenses:Food $20 + Assets:Cash + +test reg +12-Feb-29 E-trade Bank Expenses:Food $20 $20 + Assets:Cash $-20 0 +end test diff --git a/test/regress/6D9066DD.test b/test/regress/6D9066DD.test new file mode 100644 index 00000000..aa885f7d --- /dev/null +++ b/test/regress/6D9066DD.test @@ -0,0 +1,17 @@ +2009/09/23 * (EFT) Elec Ext Deposit AMAZON.COM FZXXOLTQ - Retail dis payments.amazon.com + Assets:Checking $39.05 + Assets:Receivable:Amazon + +2007/10/15 * FOO ; :USA: + Assets:NRL:Checking $1,726.18 + Assets:Receivable:CEG ; [2007/10/05] + +test print +2009/09/23 * (EFT) Elec Ext Deposit AMAZON.COM FZXXOLTQ - Retail dis payments.amazon.com + Assets:Checking $39.05 + Assets:Receivable:Amazon + +2007/10/15 * FOO ; :USA: + Assets:NRL:Checking $1,726.18 + Assets:Receivable:CEG ; [2007/10/05] +end test diff --git a/test/regress/6E041C52.test b/test/regress/6E041C52.test new file mode 100644 index 00000000..0a56dd70 --- /dev/null +++ b/test/regress/6E041C52.test @@ -0,0 +1,8 @@ +2012-03-16 KFC + Expenses:E of March: End of April $100.00 + Assets:Cash + +test reg +12-Mar-16 KFC Ex:E of: End of April $100.00 $100.00 + Assets:Cash $-100.00 0 +end test diff --git a/test/regress/751B2357.test b/test/regress/751B2357.test new file mode 100644 index 00000000..2b0f9a16 --- /dev/null +++ b/test/regress/751B2357.test @@ -0,0 +1,17 @@ +01.10.2011 4b4e2a89 + ef9d9585:efa1fb7b:22845e93:0e3763f0 2,00 A + 2c166ff7:d34e3aa1:8a5075b3:56f3c726 + +01.10.2011 15983995 + eb78b6c0:a2857de3:d6d8ea07:6688fc4e 2,58 A + ba3ffe56:c3ba36a5:aa63399f:e9e1d043 + +test print --date-format=%d.%m.%Y --input-date-format=%d.%m.%Y +01.10.2011 4b4e2a89 + ef9d9585:efa1fb7b:22845e93:0e3763f0 2,00 A + 2c166ff7:d34e3aa1:8a5075b3:56f3c726 + +01.10.2011 15983995 + eb78b6c0:a2857de3:d6d8ea07:6688fc4e 2,58 A + ba3ffe56:c3ba36a5:aa63399f:e9e1d043 +end test diff --git a/test/regress/786A3DD0.test b/test/regress/786A3DD0.test new file mode 100644 index 00000000..051f6382 --- /dev/null +++ b/test/regress/786A3DD0.test @@ -0,0 +1,17 @@ +D 1000.00 EUR + +2011-02-27 * Australia + A -100.00 AUD @ 0.746 EUR + B + +2012-03-12 * Withdrawal + Assets:Cash USD 200.00 + Expenses:Banking:Fees USD 2.50 + Assets:Chequing CAD -203.42 + Epenses:Banking:Fees CAD 2.00 + Assets:Chqeuing CAD -2.00 + +test pricedb +P 2011/02/27 00:00:00 AUD 0.746 EUR +P 2012/03/12 00:00:00 USD CAD 1.00454320987654321 +end test diff --git a/test/regress/78AB4B87.dat b/test/regress/78AB4B87.dat new file mode 100644 index 00000000..45b3028a --- /dev/null +++ b/test/regress/78AB4B87.dat @@ -0,0 +1,14 @@ +D 1000.00 EUR +P 2011-01-01 GBP 1.2 EUR + +2011-01-01 * Opening balance + Assets:Bank 10.00 GBP + Equity:Opening balance + +2012-01-02 * Test + Assets:Bank 5.00 GBP + Income:Whatever + +2012-01-03 * Test + Assets:Bank + Income:Whatever -5.00 EUR @ 0.8733 GBP diff --git a/test/regress/78AB4B87.py b/test/regress/78AB4B87.py new file mode 100644 index 00000000..fed95b54 --- /dev/null +++ b/test/regress/78AB4B87.py @@ -0,0 +1,27 @@ +import ledger + +eur = ledger.commodities.find_or_create('EUR') + +total_eur = ledger.Amount("0.00 EUR") +total_gbp = ledger.Amount("0.00 GBP") +total = ledger.Amount("0.00 EUR") + +for post in ledger.read_journal("test/regress/78AB4B87.dat").query("^income:"): + print post.amount + print post.amount.commodity + if post.amount.commodity == "EUR": + total_eur += post.amount + elif post.amount.commodity == "GBP": + total_gbp += post.amount + + a = post.amount.value(eur) + if a: + print "Total is presently: (%s)" % total + print "Converted to EUR: (%s)" % a + total += a + print "Total is now: (%s)" % total + else: + print "Cannot convert '%s'" % post.amount + print + +print total diff --git a/test/regress/78AB4B87_py.test b/test/regress/78AB4B87_py.test new file mode 100644 index 00000000..8f847145 --- /dev/null +++ b/test/regress/78AB4B87_py.test @@ -0,0 +1,15 @@ +test python test/regress/78AB4B87.py +-5.00 GBP +GBP +Total is presently: (0.00 EUR) +Converted to EUR: (-5.73 EUR) +Total is now: (-5.73 EUR) + +-5.00 EUR {0.8733 GBP} [2012/01/03] +EUR +Total is presently: (-5.73 EUR) +Converted to EUR: (-5.00 EUR) +Total is now: (-10.73 EUR) + +-10.73 EUR +end test diff --git a/test/regress/82763D86.test b/test/regress/82763D86.test new file mode 100644 index 00000000..e580077d --- /dev/null +++ b/test/regress/82763D86.test @@ -0,0 +1,35 @@ +; Test for: 'ledger -f doc/sample.dat reg -s -n liab' elides too much +; It collapses the account down to "<Total>", even though there was +; only one account! + += /^Expenses:Books/ + (Liabilities:Taxes) -0.10 + +~ Monthly + Assets:Bank:Checking $500.00 + Income:Salary + +2004/05/01 * Checking balance + Assets:Bank:Checking $1,000.00 + Equity:Opening Balances + +2004/05/01 * Investment balance + Assets:Brokerage 50 AAPL @ $30.00 + Equity:Opening Balances + +2004/05/14 * Pay day + Assets:Bank:Checking $500.00 + Income:Salary + +2004/05/27 Book Store + Expenses:Books $20.00 + Liabilities:MasterCard + +2004/05/27 (100) Credit card company + Liabilities:MasterCard $20.00 + Assets:Bank:Checking + +test -s reg liabilities +04-May-27 - 04-May-27 (Liabilities:Taxes) $-2.00 $-2.00 +end test + diff --git a/test/regress/83B4A0E5.test b/test/regress/83B4A0E5.test new file mode 100644 index 00000000..f9402a2d --- /dev/null +++ b/test/regress/83B4A0E5.test @@ -0,0 +1,43 @@ +P 2012-03-01 EUR $2 +P 2012-03-01 GBP $2 + +2012-03-05 KFC + Expenses:Food 10 EUR + Assets:Cash + +2012-03-10 KFC + Expenses:Food 10 GBP + Assets:Cash + +test reg food +12-Mar-05 KFC Expenses:Food 10 EUR 10 EUR +12-Mar-10 KFC Expenses:Food 10 GBP 10 EUR + 10 GBP +end test + +test reg food -V +12-Mar-05 KFC Expenses:Food $20 $20 +12-Mar-10 KFC Expenses:Food $20 $40 +end test + +test reg food -X '$' +12-Mar-05 KFC Expenses:Food $20 $20 +12-Mar-10 KFC Expenses:Food $20 $40 +end test + +test reg food -X '$,GBP' +12-Mar-05 KFC Expenses:Food $20 $20 +12-Mar-10 KFC Expenses:Food 10 GBP $20 + 10 GBP +end test + +test reg food -X '$!,GBP' +12-Mar-05 KFC Expenses:Food $20 $20 +12-Mar-10 KFC Expenses:Food $20 $40 +end test + +test reg food -X '$,EUR' +12-Mar-05 KFC Expenses:Food 10 EUR 10 EUR +12-Mar-10 KFC Expenses:Food $20 $20 + 10 EUR +end test diff --git a/test/regress/854150DF.test b/test/regress/854150DF.test new file mode 100644 index 00000000..7133e183 --- /dev/null +++ b/test/regress/854150DF.test @@ -0,0 +1,25 @@ +2011-11-10 * test + A:B:C 12.50 GBP + A:C + +test bal --flat -d "depth>=2" + 12.50 GBP A:B:C + -12.50 GBP A:C +-------------------- + 0 +end test + +test bal --flat -d "depth>1" + 12.50 GBP A:B:C + -12.50 GBP A:C +-------------------- + 0 +end test + +test bal --flat -d "depth>2" + 12.50 GBP A:B:C +end test + +test bal --flat -d "depth==2" + -12.50 GBP A:C +end test diff --git a/test/regress/889BB167.test b/test/regress/889BB167.test new file mode 100644 index 00000000..02e25ab6 --- /dev/null +++ b/test/regress/889BB167.test @@ -0,0 +1,17 @@ +D 1000.00 GBP + +P 2011-01-01 EUR 0.8604 GBP +P 2011-02-01 EUR 0.8576 GBP + +2011-01-31 * AdSense earnings + Assets:Receivable:AdSense 11.00 EUR + Income:AdSense + +2011-02-28 * AdSense earnings + Assets:Receivable:AdSense 10.00 EUR + Income:AdSense + +test reg income:adse -X GBP -H +11-Jan-31 AdSense earnings Income:AdSense -9.46 GBP -9.46 GBP +11-Feb-28 AdSense earnings Income:AdSense -8.58 GBP -18.04 GBP +end test diff --git a/test/regress/89233B6D-a.dat b/test/regress/89233B6D-a.dat new file mode 100644 index 00000000..01d00e9a --- /dev/null +++ b/test/regress/89233B6D-a.dat @@ -0,0 +1,4 @@ +1994/01/02 * Salary + Asssets:Bank:Checking 200.00 + Income:Salary -200.00 + diff --git a/test/regress/89233B6D-b.dat b/test/regress/89233B6D-b.dat new file mode 100644 index 00000000..f54dc66f --- /dev/null +++ b/test/regress/89233B6D-b.dat @@ -0,0 +1,4 @@ +1994/01/02 * Rent + Expenses:Rent 100.00 + Asssets:Bank:Checking -100.00 + diff --git a/test/regress/89233B6D.test b/test/regress/89233B6D.test new file mode 100644 index 00000000..e6bd38f5 --- /dev/null +++ b/test/regress/89233B6D.test @@ -0,0 +1,13 @@ +!apply account A +!include 89233B6D-a.dat +!end + +!apply account B +!include 89233B6D-b.dat +!end + +test reg "^A:" +94-Jan-02 Salary A:Assset:Bank:Checking 200 200 + A:Income:Salary -200 0 +end test + diff --git a/test/regress/8CE88DB4.test b/test/regress/8CE88DB4.test new file mode 100644 index 00000000..52fe0a9b --- /dev/null +++ b/test/regress/8CE88DB4.test @@ -0,0 +1,11 @@ +2010-01-01 * Test + Expenses:Food 100.00 EUR + Assets:Cash -100.00 EUR + +2011-07-30 * Exchange EUR to BAM + Assets:Cash -22.00 EUR + Assets:Cash 44.00 BAM + +test pricedb +P 2011/07/30 00:00:00 EUR 2.00 BAM +end test diff --git a/test/regress/8EAF77C0.test b/test/regress/8EAF77C0.test new file mode 100644 index 00000000..f0a2829c --- /dev/null +++ b/test/regress/8EAF77C0.test @@ -0,0 +1,17 @@ +2011/08/05 Rehab Donation + Asset:Bank:Boi:Current:Dk 10 + Expense:Misc:Charity + + 2011/08/07 Net Salary + Asset:Bank:Boi:Savings:Dk -3016.24 + Income:NetSalary:Dk + +2011/08/30 Net Salary + Asset:Bank:Boi:Savings:Dk -3016.24 + Income:NetSalary:Dk + +test reg -> 1 +__ERROR__ +While parsing file "$FILE", line 5: +Error: Unexpected whitespace at beginning of line +end test diff --git a/test/regress/9188F587.py b/test/regress/9188F587.py new file mode 100644 index 00000000..50195252 --- /dev/null +++ b/test/regress/9188F587.py @@ -0,0 +1,27 @@ +import ledger + +eur = ledger.commodities.find_or_create('EUR') + +total_eur = ledger.Amount("0.00 EUR") +total_gbp = ledger.Amount("0.00 GBP") +total = ledger.Amount("0.00 EUR") + +for post in ledger.read_journal("test/regress/78AB4B87.dat").query("^income:"): + print post.amount + print post.amount.commodity + if post.amount.commodity == "EUR": + total_eur += post.amount + elif post.amount.commodity == "GBP": + total_gbp += post.amount + + a = post.amount.value(eur, post.date) + if a: + print "Total is presently: (%s)" % total + print "Converted to EUR: (%s)" % a + total += a + print "Total is now: (%s)" % total + else: + print "Cannot convert '%s'" % post.amount + print + +print total diff --git a/test/regress/9188F587_py.test b/test/regress/9188F587_py.test new file mode 100644 index 00000000..28bb34ff --- /dev/null +++ b/test/regress/9188F587_py.test @@ -0,0 +1,15 @@ +test python test/regress/9188F587.py +-5.00 GBP +GBP +Total is presently: (0.00 EUR) +Converted to EUR: (-6.00 EUR) +Total is now: (-6.00 EUR) + +-5.00 EUR {0.8733 GBP} [2012/01/03] +EUR +Total is presently: (-6.00 EUR) +Converted to EUR: (-5.00 EUR) +Total is now: (-11.00 EUR) + +-11.00 EUR +end test diff --git a/test/regress/95350193.test b/test/regress/95350193.test new file mode 100644 index 00000000..dadb39cf --- /dev/null +++ b/test/regress/95350193.test @@ -0,0 +1,6 @@ +2011-11-08 * Test + Assets:Voucher:Amazon 137.87 GBP (48H5) + Assets:Cash -137.87 GBP + +test pricedb +end test diff --git a/test/regress/96A8E4A1.test b/test/regress/96A8E4A1.test new file mode 100644 index 00000000..93fb55d2 --- /dev/null +++ b/test/regress/96A8E4A1.test @@ -0,0 +1,10 @@ +2011-01-31 * Test + Expenses:Travel 1 "Spr MegaBonus" + Assets:Voucher + +test -X EUR -H bal + -1 "Spr MegaBonus" Assets:Voucher + 1 "Spr MegaBonus" Expenses:Travel +-------------------- + 0 +end test diff --git a/test/regress/9E0E606D.test b/test/regress/9E0E606D.test new file mode 100644 index 00000000..86b8e36f --- /dev/null +++ b/test/regress/9E0E606D.test @@ -0,0 +1,19 @@ +D 1000.00 GBP + +P 2011-02-01 EUR 0.8576 GBP +P 2011-03-01 EUR 0.8612 GBP +P 2011-04-01 EUR 0.8510 GBP + +2011-01-31 * AdSense earnings + Assets:Receivable:AdSense 11.00 EUR + Income:AdSense + +2011-02-28 * AdSense earnings + Assets:Receivable:AdSense 10.00 EUR + Income:AdSense + +test reg income:ad -X GBP -H +11-Jan-31 AdSense earnings Income:AdSense -11.00 EUR -11.00 EUR +11-Feb-28 Commodities revalued <Revalued> -9.43 GBP -9.43 GBP +11-Feb-28 AdSense earnings Income:AdSense -8.58 GBP -18.01 GBP +end test diff --git a/test/regress/A560FDAD.test b/test/regress/A560FDAD.test new file mode 100644 index 00000000..ee19e71e --- /dev/null +++ b/test/regress/A560FDAD.test @@ -0,0 +1,85 @@ +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 +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 <Adjustment> 0.01 EUR 5.81 EUR + Income:Test -3218.04 EUR -3212.23 EUR + <Adjustment> -0.01 EUR -3212.24 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 + <Adjustment> 0.01 EUR -2911.81 EUR + Expenses:Test 304.82 EUR -2606.99 EUR + <Adjustment> -0.01 EUR -2607.00 EUR + Assets:Current 2612.80 EUR 5.80 EUR +end test diff --git a/test/regress/A8FCC765.dat b/test/regress/A8FCC765.dat new file mode 100644 index 00000000..abc51a0a --- /dev/null +++ b/test/regress/A8FCC765.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/regress/A8FCC765.test b/test/regress/A8FCC765.test new file mode 100644 index 00000000..1adf6053 --- /dev/null +++ b/test/regress/A8FCC765.test @@ -0,0 +1,8 @@ +2012-03-17 KFC + Expenses:Food 20 CAD + Assets:Cash + +test pricedb --price-db test/regress/A8FCC765.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/regress/ACE05ECE.test b/test/regress/ACE05ECE.test new file mode 100644 index 00000000..72ea562b --- /dev/null +++ b/test/regress/ACE05ECE.test @@ -0,0 +1,6 @@ +i 2011/07/20 17:00:00 Hello Work project +o 2011/07/21 01:00:00 Hello + +test reg Hello +11-Jul-20 Work project (Hello) 8.00h 8.00h +end test diff --git a/test/regress/AEDE9734.test b/test/regress/AEDE9734.test new file mode 100644 index 00000000..cd2245b8 --- /dev/null +++ b/test/regress/AEDE9734.test @@ -0,0 +1,12 @@ +2011-02-23 Rocket Fuel + Expense:Travel $100000000.00 ; trip: Moon + Asset:NASA + +2011-02-23 Liquid Oxygen + Expense:Travel $232233223.00 ; trip: Moon + Asset:NASA + +test bal --group-by "tag('trip')" +Moon + $332233223.00 Expense:Travel +end test diff --git a/test/regress/AFAFB804.test b/test/regress/AFAFB804.test new file mode 100644 index 00000000..472540fb --- /dev/null +++ b/test/regress/AFAFB804.test @@ -0,0 +1,57 @@ +; Test for: ledger should allow sorting by multiple criteria, like: +; -S date,payee + +2010-02-09 * Z + A $10 + B + +2010-02-09 * Y + B $10 + C + +2010-02-09 * X + C $10 + D + +2010-02-10 * Z + A $15 + B + +2010-02-10 * Y + B $15 + C + +2010-02-10 * X + C $15 + D + +test reg -S date,payee +10-Feb-09 X C $10 $10 + D $-10 0 +10-Feb-09 Y B $10 $10 + C $-10 0 +10-Feb-09 Z A $10 $10 + B $-10 0 +10-Feb-10 X C $15 $15 + D $-15 0 +10-Feb-10 Y B $15 $15 + C $-15 0 +10-Feb-10 Z A $15 $15 + B $-15 0 +end test + +test reg -S payee,date +10-Feb-09 X C $10 $10 + D $-10 0 +10-Feb-10 X C $15 $15 + D $-15 0 +10-Feb-09 Y B $10 $10 + C $-10 0 +10-Feb-10 Y B $15 $15 + C $-15 0 +10-Feb-09 Z A $10 $10 + B $-10 0 +10-Feb-10 Z A $15 $15 + B $-15 0 +end test + diff --git a/test/regress/BFD3FBE1.test b/test/regress/BFD3FBE1.test new file mode 100644 index 00000000..0dbda2c7 --- /dev/null +++ b/test/regress/BFD3FBE1.test @@ -0,0 +1,16 @@ +2011-01-01 * Opening balance + Assets:Investment 100 "AAA" @ 16.58900489 EUR + Assets:Investments 5 "BBB" @ 24.79900855 EUR + Equity:Opening balance + +2011-02-10 * Reimbursement: Taxi / Subway / Bus / Train + Assets:A 1.59 GBP + Assets:B -1.80 EUR @ 0.884955752212389381 GBP + +test reg -X EUR -H +11-Jan-01 Opening balance Assets:Investment 1658.90 EUR 1658.90 EUR + Assets:Investments 124.00 EUR 1782.90 EUR + Equity:Opening balance -1782.90 EUR 0 +11-Feb-10 Reimbursement: Taxi.. Assets:A 1.80 EUR 1.80 EUR + Assets:B -1.80 EUR 0 +end test diff --git a/test/regress/C19E4E9B.test b/test/regress/C19E4E9B.test new file mode 100644 index 00000000..4837b4cd --- /dev/null +++ b/test/regress/C19E4E9B.test @@ -0,0 +1,18 @@ +2012-01-01=2012-01-02 * Buy AAA + A 1 AAA @ 1.00 EUR + B -1.00 EUR + +2012-02-01 * Buy AAA + A 1 AAA @ 2.00 EUR + B -2.00 EUR + +test reg --format "%S: %d %P %t %T\n" +$FILE: 2012/01/01 Buy AAA 1 AAA 1 AAA +$FILE: 2012/01/01 Buy AAA -1.00 EUR 1 AAA +-1.00 EUR +$FILE: 2012/02/01 Buy AAA 1 AAA 2 AAA +-1.00 EUR +$FILE: 2012/02/01 Buy AAA -2.00 EUR 2 AAA +-3.00 EUR +end test + diff --git a/test/regress/C927CFFE.test b/test/regress/C927CFFE.test new file mode 100644 index 00000000..d455b480 --- /dev/null +++ b/test/regress/C927CFFE.test @@ -0,0 +1,43 @@ + +2010/02/09 * Test 1 + A $10 + B + +2010/02/10 * Test 2 + B $10 + C + +2010/02/11 * Test 3 + C $10 + D + +test reg +test -l "date>=[2010/02/10]" reg +10-Feb-10 Test 2 B $10 $10 + C $-10 0 +10-Feb-11 Test 3 C $10 $10 + D $-10 0 +end test + +test -l "date<=[2010/02/10]" reg +10-Feb-09 Test 1 A $10 $10 + B $-10 0 +10-Feb-10 Test 2 B $10 $10 + C $-10 0 +end test + +test -l "date==[2010/02/10]" reg +10-Feb-10 Test 2 B $10 $10 + C $-10 0 +end test + +test -l "date>[2010/02/10]" reg +10-Feb-11 Test 3 C $10 $10 + D $-10 0 +end test + +test -l "date<[2010/02/10]" reg +10-Feb-09 Test 1 A $10 $10 + B $-10 0 +end test + diff --git a/test/regress/C9D593B3.test b/test/regress/C9D593B3.test new file mode 100644 index 00000000..1cb73080 --- /dev/null +++ b/test/regress/C9D593B3.test @@ -0,0 +1,23 @@ +2012-03-16 KFC + Expenses:Food $20 + Assets:Cash + +2012-03-16 KFC + Expenses:Food $20 + Assets:Cash + +2012-03-16 KFC + Expenses:Food $20 + Assets:Cash + +2012-03-16 KFC + Expenses:Food $20 + Assets:Cash + +2012-03-16 KFC + Expenses:Food $20 + Assets:Cash + +test payees +KFC +end test diff --git a/test/regress/CEECC0B0.test b/test/regress/CEECC0B0.test new file mode 100644 index 00000000..1465b8c3 --- /dev/null +++ b/test/regress/CEECC0B0.test @@ -0,0 +1,19 @@ +2012-01-01 * Opening Balances + Assets:Cash 100.00 EUR + Equity:Opening balances -100.00 EUR + +2012-01-02 * Buy AAA + Assets:Investments 1 AAA @ 10.00 EUR + Assets:Cash -10.00 EUR + +2012-01-03 * Sell AAA + Assets:Investments -1 AAA @ 10.00 EUR + Assets:Cash 10.00 EUR + + +test equity +2012/01/03 Opening Balances + Assets:Cash 100.00 EUR + Equity:Opening balances +end test + diff --git a/test/regress/CFE5D8AA.test b/test/regress/CFE5D8AA.test new file mode 100644 index 00000000..857dad13 --- /dev/null +++ b/test/regress/CFE5D8AA.test @@ -0,0 +1,20 @@ +~ monthly + assets:checking $1,000.00 + income:work:salary $-1,000.00 + +~ monthly + ; note + assets:checking $1,000.00 + income:work:salary $-1,000.00 + +~ monthly + assets:checking $1,000.00 + income:work:salary + +~ monthly + ; note + assets:checking $1,000.00 + income:work:salary + +test reg +end test diff --git a/test/regress/D51BFF74.test b/test/regress/D51BFF74.test new file mode 100644 index 00000000..a13af897 --- /dev/null +++ b/test/regress/D51BFF74.test @@ -0,0 +1,24 @@ +2012-03-16 KFC + Expenses:Food $-20 + Assets:Cash + +2012-03-16 KFC + Expenses:Food $- 20 + Assets:Cash + +2012-03-16 KFC + Expenses:Food -$20 + Assets:Cash + +2012-03-16 KFC + Expenses:Food - $20 + Assets:Cash + +test reg -> 1 +__ERROR__ +While parsing file "$FILE", line 6: +While parsing posting: + Expenses:Food $- 20 + ^^^^^ +Error: No quantity specified for amount +end test diff --git a/test/regress/D943AE0F.test b/test/regress/D943AE0F.test index 960fbe13..10082f75 100644 --- a/test/regress/D943AE0F.test +++ b/test/regress/D943AE0F.test @@ -6,7 +6,7 @@ D 1000.00 EUR P 2008/04/20 00:00:00 CAD 1.20 EUR -test reg -V +test reg -V --now=2008/04/20 08-Apr-15 Paid expenses back .. Exp:Cie-Reimbursements 2200.00 EUR 2200.00 EUR Assets:Checking -2200.00 EUR 0 08-Apr-20 Commodities revalued <Revalued> 200.00 EUR 200.00 EUR diff --git a/test/regress/D9C8EB08.test b/test/regress/D9C8EB08.test new file mode 100644 index 00000000..fa02431b --- /dev/null +++ b/test/regress/D9C8EB08.test @@ -0,0 +1,16 @@ +; Test for: Using ! erroneously in a data file causes a segfault + +! Assets:Cash + +2008/01/01 January + Expenses:Books $10.00 + Assets:Cash + +!end + +test bal -> 1 +__ERROR__ +While parsing file "$FILE", line 9: +Error: 'end' or 'end apply' found, but no enclosing 'apply' directive +end test + diff --git a/test/regress/DB490507.test b/test/regress/DB490507.test new file mode 100644 index 00000000..24443d2a --- /dev/null +++ b/test/regress/DB490507.test @@ -0,0 +1,25 @@ +2001/11/07=2001/11/04 * Autoroutes du Sud de la France + Dépense:Vacances:Voyage ; 14F Tlse-Montauban, 8F Montauban-Caussade, 8F Caussade-Montauban, 14F Montauban-Tlse + Actif:Courant:BnpCc -6,71 € + +2008/01/20 * La Poste + Equity + Actif:Courant:LaPosteLivretA 10,00 € + +2008/01/20 * La Poste + Revenu:Invest:Exonéré + Actif:Courant:LaPosteLivretA 25,24 € = 35,24 € + +test print --decimal-comma --columns=999 +2001/11/07=2001/11/04 * Autoroutes du Sud de la France + Dépense:Vacances:Voyage ; 14F Tlse-Montauban, 8F Montauban-Caussade, 8F Caussade-Montauban, 14F Montauban-Tlse + Actif:Courant:BnpCc -6,71 € + +2008/01/20 * La Poste + Equity + Actif:Courant:LaPosteLivretA 10,00 € + +2008/01/20 * La Poste + Revenu:Invest:Exonéré + Actif:Courant:LaPosteLivretA 25,24 € = 35,24 € +end test diff --git a/test/regress/DDB54BB8.test b/test/regress/DDB54BB8.test new file mode 100644 index 00000000..7d72043c --- /dev/null +++ b/test/regress/DDB54BB8.test @@ -0,0 +1,18 @@ +~ Monthly + Aufwand:Bargeld 0,30€ + Aktiva:Bank:Girokonto -0,40€ + +test bal -> 1 +__ERROR__ +While parsing file "$FILE", line 3: +Unbalanced remainder is: + -0,10€ +Amount to balance against: + 0,30€ +While parsing periodic transaction: +> ~ Monthly +> Aufwand:Bargeld 0,30€ +> Aktiva:Bank:Girokonto -0,40€ +Error: Transaction does not balance +end test + diff --git a/test/regress/E2E479BC.test b/test/regress/E2E479BC.test new file mode 100644 index 00000000..8216028a --- /dev/null +++ b/test/regress/E2E479BC.test @@ -0,0 +1,17 @@ +; Test for: ledger used to show multiple "Income:Unknown" in this +; case in the past, which it shouldn't. + +2009/01/01 Sample + Expenses:Alpha 10 A + Expenses:Beta 10 B + Expenses:Gamma 10 C + Income:Unknown + +test print +2009/01/01 Sample + Expenses:Alpha 10 A + Expenses:Beta 10 B + Expenses:Gamma 10 C + Income:Unknown +end test + diff --git a/test/regress/EA18D948.test b/test/regress/EA18D948.test new file mode 100644 index 00000000..a63d4c35 --- /dev/null +++ b/test/regress/EA18D948.test @@ -0,0 +1,14 @@ +2012-01-01 * Buy AAA + A 1 AAA @ 1.00 EUR + B -1.00 EUR + +2012-02-01 * Buy AAA + A 1 AAA @ 2.00 EUR + B -2.00 EUR + +test reg A -V -A +12-Jan-01 Buy AAA A 1.00 EUR 1.00 EUR +12-Feb-01 Commodities revalued <Revalued> 1.00 EUR 0 +12-Feb-01 Buy AAA A 2.00 EUR 2.00 EUR +end test + diff --git a/test/regress/F06D5554.test b/test/regress/F06D5554.test new file mode 100644 index 00000000..4541b791 --- /dev/null +++ b/test/regress/F06D5554.test @@ -0,0 +1,552 @@ +2011/04/01 serveraxis.com + Expenses:Computer:Internet $15.00 + Expenses:Computer:Internet $1.10 + Liabilities:MasterCard + +2011/04/05 Pennsylvania toll booth + Expenses:Auto:Fees $13.00 + Expenses:Cash + +2011/04/05 iTunes + Expenses:Music $1.29 + Expenses:Taxes:Sales $0.09 + Liabilities:MasterCard $-1.38 + +2011/04/19 iTunes + Expenses:Computer:Software $4.99 + Expenses:Taxes:Sales $0.35 + Liabilities:MasterCard $-5.34 + +2011/04/24 iTunes + Expenses:Movies $1.99 + Expenses:Movies $2.99 + Expenses:Taxes:Sales $0.35 + Liabilities:MasterCard $-5.33 + +2011/04/29 iTunes + Expenses:Computer:Movies $0.99 + Expenses:Taxes:Sales $0.07 + Liabilities:MasterCard $-1.06 + +2011/05/01 serveraxis.com + Expenses:Computer:Internet $15.00 + Expenses:Computer:Internet $1.10 + Liabilities:MasterCard + +2011/05/18 iTunes + Expenses:Computer:Software $6.99 + Expenses:Taxes:Sales $0.49 + Liabilities:MasterCard $-7.48 + +2011/05/20 DynDNS.com + Expenses:Computer:Internet $15.00 + Liabilities:MasterCard + +2011/05/20 DynDNS.com + Expenses:Computer:Internet $15.00 + Liabilities:MasterCard + +2011/05/27 iTunes + Expenses:Movies $1.99 + Expenses:Movies $1.99 + Expenses:Movies $1.99 + Expenses:Taxes:Sales $0.42 + Liabilities:MasterCard $-6.39 + +2011/05/26 Valero + Expenses:Auto:Gas $26.79 + Liabilities:MasterCard + +2011/05/26 Starbucks + Expenses:Food $2.20 + Expenses:Taxes:Sales $0.15 + Liabilities:MasterCard $-2.35 + +2011/05/26 La Mex + Expenses:Food $17.70 + Expenses:Taxes:Sales $1.11 + Expenses:Tips $3.00 + Liabilities:MasterCard $-21.81 + +2011/05/27 Leaves N Beans + Expenses:Food:Dining $20.98 + Expenses:Taxes:Sales $1.63 + Expenses:Tips $2.00 + Liabilities:MasterCard $-24.61 + +2011/05/27 Wal*Mart + Expenses:Home:Supplies $7.97 + Expenses:Food:Grocery $3.25 + Expenses:Food:Grocery $3.18 + Expenses:Food:Grocery $3.18 + Expenses:Food:Grocery $2.98 + Expenses:Food:Grocery $1.98 + Expenses:Food:Grocery $3.98 + Expenses:Food:Grocery $3.58 + Expenses:Food:Grocery $3.58 + Expenses:Food:Grocery $1.58 + Expenses:Food:Grocery $1.88 + Expenses:Food:Grocery $2.50 + Expenses:Food:Grocery $1.26 + Expenses:Food:Grocery $2.62 + Expenses:Food:Grocery $3.48 + Expenses:Home:Supplies $1.37 + Expenses:Home:Supplies $2.92 + Expenses:Beauty $3.38 + Expenses:Beauty $0.97 + Expenses:Beauty $4.64 + Expenses:Beauty $1.97 + Expenses:Beauty $1.97 + Expenses:Beauty $5.98 + Expenses:Home:Supplies $9.98 + Expenses:Bedding $4.00 + Expenses:Bedding $4.00 + Expenses:Home:Supplies $2.88 + Expenses:Home:Supplies $2.88 + Expenses:Home:Supplies $2.88 + Expenses:Home:Supplies $2.88 + Expenses:Clothing $2.96 + Expenses:Supplies $0.84 + Expenses:Food:Grocery $1.38 + Expenses:Food:Grocery $1.38 + Expenses:Food:Grocery $2.32 + Expenses:Food:Grocery $2.00 + Expenses:Food:Grocery $2.98 + Expenses:Food:Grocery $3.00 + Expenses:Food:Grocery $2.14 + Expenses:Food:Grocery $2.14 + Expenses:Food:Grocery $2.50 + Expenses:Food:Grocery $2.50 + Expenses:Food:Grocery $3.48 + Expenses:Home:Supplies $1.17 + Expenses:Supplies $3.00 + Expenses:Bedding $34.88 + Expenses:Home $6.00 + Expenses:Home $6.00 + Expenses:Home:Supplies $3.97 + Expenses:Food:Grocery $0.78 + Expenses:Food:Grocery $0.78 + Expenses:Food:Grocery $0.78 + Expenses:Food:Grocery $0.78 + Expenses:Home $4.00 + Expenses:Home $4.00 + Expenses:Home $10.87 + Expenses:Home $4.00 + Expenses:Bedding $65.96 + Expenses:Taxes:Sales $16.89 + Expenses:Taxes:Sales $0.65 + Liabilities:MasterCard $-293.83 + +2011/05/27 Asia Grill + Expenses:Food:Dining $28.63 + Expenses:Tips $4.00 + Liabilities:MasterCard $-32.63 + +2011/05/28 Shell + Expenses:Auto:Gas $43.41 + Liabilities:MasterCard + +2011/05/28 Sears + Expenses:Home $1,728.96 + Expenses:Taxes:Sales $136.87 + Liabilities:MasterCard $-1,865.83 + +2011/05/28 Sears + Expenses:Home $99.61 + Expenses:Taxes:Sales $8.22 + Liabilities:MasterCard $-107.83 + +2011/05/28 Buffalo Wild Wings + Expenses:Food:Dining $22.98 + Expenses:Tips $2.35 + Expenses:Taxes:Sales $3.50 + Liabilities:MasterCard $-28.83 + +2011/05/28 Cold Stone Creamery + Expenses:Food:Dining $5.73 + Expenses:Tips $0.50 + Liabilities:MasterCard $-6.23 + +2011/05/29 Hy Vee + Expenses:Supplies $2.00 + Expenses:Supplies $7.99 + Expenses:Supplies $7.99 + Expenses:Food:Grocery $157.64 + Expenses:Taxes:Sales $5.74 + Liabilities:MasterCard $-181.36 + +2011/05/30 Allied movers, Fidel & Manny + Expenses:Tips $97.00 + Expenses:Cash + +2011/05/30 Starbucks + Expenses:Food:Dining $6.90 + Expenses:Taxes:Sales $0.71 + Liabilities:MasterCard $-7.61 + +2011/05/31 Wal*Mart + Expenses:Home $108.13 + Expenses:Taxes:Sales $8.65 + Liabilities:MasterCard $-116.78 + +test reg -p "apr 2011" Expenses +11-Apr-01 serveraxis.com Expe:Computer:Internet $15.00 $15.00 + Expe:Computer:Internet $1.10 $16.10 +11-Apr-05 Pennsylvania toll b.. Expenses:Auto:Fees $13.00 $29.10 + Expenses:Cash $-13.00 $16.10 +11-Apr-05 iTunes Expenses:Music $1.29 $17.39 + Expenses:Taxes:Sales $0.09 $17.48 +11-Apr-19 iTunes Expe:Computer:Software $4.99 $22.47 + Expenses:Taxes:Sales $0.35 $22.82 +11-Apr-24 iTunes Expenses:Movies $1.99 $24.81 + Expenses:Movies $2.99 $27.80 + Expenses:Taxes:Sales $0.35 $28.15 +11-Apr-29 iTunes Expens:Computer:Movies $0.99 $29.14 + Expenses:Taxes:Sales $0.07 $29.21 +end test + +test reg -p "apr 2011" Expenses --monthly +11-Apr-01 - 11-Apr-30 Expenses:Auto:Fees $13.00 $13.00 + Expenses:Cash $-13.00 0 + Expe:Computer:Internet $16.10 $16.10 + Expens:Computer:Movies $0.99 $17.09 + Expe:Computer:Software $4.99 $22.08 + Expenses:Movies $4.98 $27.06 + Expenses:Music $1.29 $28.35 + Expenses:Taxes:Sales $0.86 $29.21 +end test + +test reg -p "apr 2011" Expenses --monthly --exact +11-Apr-01 - 11-Apr-29 Expenses:Auto:Fees $13.00 $13.00 + Expenses:Cash $-13.00 0 + Expe:Computer:Internet $16.10 $16.10 + Expens:Computer:Movies $0.99 $17.09 + Expe:Computer:Software $4.99 $22.08 + Expenses:Movies $4.98 $27.06 + Expenses:Music $1.29 $28.35 + Expenses:Taxes:Sales $0.86 $29.21 +end test + +test reg -p "apr 2011" Expenses --weekly +11-Apr-01 - 11-Apr-02 Expe:Computer:Internet $16.10 $16.10 +11-Apr-03 - 11-Apr-09 Expenses:Auto:Fees $13.00 $29.10 + Expenses:Cash $-13.00 $16.10 + Expenses:Music $1.29 $17.39 + Expenses:Taxes:Sales $0.09 $17.48 +11-Apr-17 - 11-Apr-23 Expe:Computer:Software $4.99 $22.47 + Expenses:Taxes:Sales $0.35 $22.82 +11-Apr-24 - 11-Apr-30 Expens:Computer:Movies $0.99 $23.81 + Expenses:Movies $4.98 $28.79 + Expenses:Taxes:Sales $0.42 $29.21 +end test + +test reg -p "apr 2011" Expenses --weekly --exact +11-Apr-01 - 11-Apr-01 Expe:Computer:Internet $16.10 $16.10 +11-Apr-05 - 11-Apr-05 Expenses:Auto:Fees $13.00 $29.10 + Expenses:Cash $-13.00 $16.10 + Expenses:Music $1.29 $17.39 + Expenses:Taxes:Sales $0.09 $17.48 +11-Apr-19 - 11-Apr-19 Expe:Computer:Software $4.99 $22.47 + Expenses:Taxes:Sales $0.35 $22.82 +11-Apr-24 - 11-Apr-29 Expens:Computer:Movies $0.99 $23.81 + Expenses:Movies $4.98 $28.79 + Expenses:Taxes:Sales $0.42 $29.21 +end test + +test reg -p "apr 2011" Expenses --weekly --empty +11-Apr-01 - 11-Apr-02 Expe:Computer:Internet $16.10 $16.10 +11-Apr-03 - 11-Apr-09 Expenses:Auto:Fees $13.00 $29.10 + Expenses:Cash $-13.00 $16.10 + Expenses:Music $1.29 $17.39 + Expenses:Taxes:Sales $0.09 $17.48 +11-Apr-10 - 11-Apr-16 <None> 0 $17.48 +11-Apr-17 - 11-Apr-23 Expe:Computer:Software $4.99 $22.47 + Expenses:Taxes:Sales $0.35 $22.82 +11-Apr-24 - 11-Apr-30 Expens:Computer:Movies $0.99 $23.81 + Expenses:Movies $4.98 $28.79 + Expenses:Taxes:Sales $0.42 $29.21 +end test + +test reg -p "apr 2011" Expenses --weekly --empty --exact +11-Apr-01 - 11-Apr-01 Expe:Computer:Internet $16.10 $16.10 +11-Apr-05 - 11-Apr-05 Expenses:Auto:Fees $13.00 $29.10 + Expenses:Cash $-13.00 $16.10 + Expenses:Music $1.29 $17.39 + Expenses:Taxes:Sales $0.09 $17.48 +11-Apr-16 - 11-Apr-16 <None> 0 $17.48 +11-Apr-19 - 11-Apr-19 Expe:Computer:Software $4.99 $22.47 + Expenses:Taxes:Sales $0.35 $22.82 +11-Apr-24 - 11-Apr-29 Expens:Computer:Movies $0.99 $23.81 + Expenses:Movies $4.98 $28.79 + Expenses:Taxes:Sales $0.42 $29.21 +end test + +test reg -p "may 2011" +11-May-01 serveraxis.com Expe:Computer:Internet $15.00 $15.00 + Expe:Computer:Internet $1.10 $16.10 + Liabilities:MasterCard $-16.10 0 +11-May-18 iTunes Expe:Computer:Software $6.99 $6.99 + Expenses:Taxes:Sales $0.49 $7.48 + Liabilities:MasterCard $-7.48 0 +11-May-20 DynDNS.com Expe:Computer:Internet $15.00 $15.00 + Liabilities:MasterCard $-15.00 0 +11-May-20 DynDNS.com Expe:Computer:Internet $15.00 $15.00 + Liabilities:MasterCard $-15.00 0 +11-May-27 iTunes Expenses:Movies $1.99 $1.99 + Expenses:Movies $1.99 $3.98 + Expenses:Movies $1.99 $5.97 + Expenses:Taxes:Sales $0.42 $6.39 + Liabilities:MasterCard $-6.39 0 +11-May-26 Valero Expenses:Auto:Gas $26.79 $26.79 + Liabilities:MasterCard $-26.79 0 +11-May-26 Starbucks Expenses:Food $2.20 $2.20 + Expenses:Taxes:Sales $0.15 $2.35 + Liabilities:MasterCard $-2.35 0 +11-May-26 La Mex Expenses:Food $17.70 $17.70 + Expenses:Taxes:Sales $1.11 $18.81 + Expenses:Tips $3.00 $21.81 + Liabilities:MasterCard $-21.81 0 +11-May-27 Leaves N Beans Expenses:Food:Dining $20.98 $20.98 + Expenses:Taxes:Sales $1.63 $22.61 + Expenses:Tips $2.00 $24.61 + Liabilities:MasterCard $-24.61 0 +11-May-27 Wal*Mart Expenses:Home:Supplies $7.97 $7.97 + Expenses:Food:Grocery $3.25 $11.22 + Expenses:Food:Grocery $3.18 $14.40 + Expenses:Food:Grocery $3.18 $17.58 + Expenses:Food:Grocery $2.98 $20.56 + Expenses:Food:Grocery $1.98 $22.54 + Expenses:Food:Grocery $3.98 $26.52 + Expenses:Food:Grocery $3.58 $30.10 + Expenses:Food:Grocery $3.58 $33.68 + Expenses:Food:Grocery $1.58 $35.26 + Expenses:Food:Grocery $1.88 $37.14 + Expenses:Food:Grocery $2.50 $39.64 + Expenses:Food:Grocery $1.26 $40.90 + Expenses:Food:Grocery $2.62 $43.52 + Expenses:Food:Grocery $3.48 $47.00 + Expenses:Home:Supplies $1.37 $48.37 + Expenses:Home:Supplies $2.92 $51.29 + Expenses:Beauty $3.38 $54.67 + Expenses:Beauty $0.97 $55.64 + Expenses:Beauty $4.64 $60.28 + Expenses:Beauty $1.97 $62.25 + Expenses:Beauty $1.97 $64.22 + Expenses:Beauty $5.98 $70.20 + Expenses:Home:Supplies $9.98 $80.18 + Expenses:Bedding $4.00 $84.18 + Expenses:Bedding $4.00 $88.18 + Expenses:Home:Supplies $2.88 $91.06 + Expenses:Home:Supplies $2.88 $93.94 + Expenses:Home:Supplies $2.88 $96.82 + Expenses:Home:Supplies $2.88 $99.70 + Expenses:Clothing $2.96 $102.66 + Expenses:Supplies $0.84 $103.50 + Expenses:Food:Grocery $1.38 $104.88 + Expenses:Food:Grocery $1.38 $106.26 + Expenses:Food:Grocery $2.32 $108.58 + Expenses:Food:Grocery $2.00 $110.58 + Expenses:Food:Grocery $2.98 $113.56 + Expenses:Food:Grocery $3.00 $116.56 + Expenses:Food:Grocery $2.14 $118.70 + Expenses:Food:Grocery $2.14 $120.84 + Expenses:Food:Grocery $2.50 $123.34 + Expenses:Food:Grocery $2.50 $125.84 + Expenses:Food:Grocery $3.48 $129.32 + Expenses:Home:Supplies $1.17 $130.49 + Expenses:Supplies $3.00 $133.49 + Expenses:Bedding $34.88 $168.37 + Expenses:Home $6.00 $174.37 + Expenses:Home $6.00 $180.37 + Expenses:Home:Supplies $3.97 $184.34 + Expenses:Food:Grocery $0.78 $185.12 + Expenses:Food:Grocery $0.78 $185.90 + Expenses:Food:Grocery $0.78 $186.68 + Expenses:Food:Grocery $0.78 $187.46 + Expenses:Home $4.00 $191.46 + Expenses:Home $4.00 $195.46 + Expenses:Home $10.87 $206.33 + Expenses:Home $4.00 $210.33 + Expenses:Bedding $65.96 $276.29 + Expenses:Taxes:Sales $16.89 $293.18 + Expenses:Taxes:Sales $0.65 $293.83 + Liabilities:MasterCard $-293.83 0 +11-May-27 Asia Grill Expenses:Food:Dining $28.63 $28.63 + Expenses:Tips $4.00 $32.63 + Liabilities:MasterCard $-32.63 0 +11-May-28 Shell Expenses:Auto:Gas $43.41 $43.41 + Liabilities:MasterCard $-43.41 0 +11-May-28 Sears Expenses:Home $1,728.96 $1,728.96 + Expenses:Taxes:Sales $136.87 $1,865.83 + Liabilities:MasterCard $-1,865.83 0 +11-May-28 Sears Expenses:Home $99.61 $99.61 + Expenses:Taxes:Sales $8.22 $107.83 + Liabilities:MasterCard $-107.83 0 +11-May-28 Buffalo Wild Wings Expenses:Food:Dining $22.98 $22.98 + Expenses:Tips $2.35 $25.33 + Expenses:Taxes:Sales $3.50 $28.83 + Liabilities:MasterCard $-28.83 0 +11-May-28 Cold Stone Creamery Expenses:Food:Dining $5.73 $5.73 + Expenses:Tips $0.50 $6.23 + Liabilities:MasterCard $-6.23 0 +11-May-29 Hy Vee Expenses:Supplies $2.00 $2.00 + Expenses:Supplies $7.99 $9.99 + Expenses:Supplies $7.99 $17.98 + Expenses:Food:Grocery $157.64 $175.62 + Expenses:Taxes:Sales $5.74 $181.36 + Liabilities:MasterCard $-181.36 0 +11-May-30 Allied movers, Fide.. Expenses:Tips $97.00 $97.00 + Expenses:Cash $-97.00 0 +11-May-30 Starbucks Expenses:Food:Dining $6.90 $6.90 + Expenses:Taxes:Sales $0.71 $7.61 + Liabilities:MasterCard $-7.61 0 +11-May-31 Wal*Mart Expenses:Home $108.13 $108.13 + Expenses:Taxes:Sales $8.65 $116.78 + Liabilities:MasterCard $-116.78 0 +end test + +test reg -p "may 2011" --monthly +11-May-01 - 11-May-31 Expenses:Auto:Gas $70.20 $70.20 + Expenses:Beauty $18.91 $89.11 + Expenses:Bedding $108.84 $197.95 + Expenses:Cash $-97.00 $100.95 + Expenses:Clothing $2.96 $103.91 + Expe:Computer:Internet $46.10 $150.01 + Expe:Computer:Software $6.99 $157.00 + Expenses:Food $19.90 $176.90 + Expenses:Food:Dining $85.22 $262.12 + Expenses:Food:Grocery $225.61 $487.73 + Expenses:Home $1,971.57 $2,459.30 + Expenses:Home:Supplies $38.90 $2,498.20 + Expenses:Movies $5.97 $2,504.17 + Expenses:Supplies $21.82 $2,525.99 + Expenses:Taxes:Sales $185.03 $2,711.02 + Expenses:Tips $108.85 $2,819.87 + Liabilities:MasterCard $-2,819.87 0 +end test + +test reg -p "may 2011" --weekly +11-May-01 - 11-May-07 Expe:Computer:Internet $16.10 $16.10 + Liabilities:MasterCard $-16.10 0 +11-May-15 - 11-May-21 Expe:Computer:Internet $30.00 $30.00 + Expe:Computer:Software $6.99 $36.99 + Expenses:Taxes:Sales $0.49 $37.48 + Liabilities:MasterCard $-37.48 0 +11-May-22 - 11-May-28 Expenses:Auto:Gas $70.20 $70.20 + Expenses:Beauty $18.91 $89.11 + Expenses:Bedding $108.84 $197.95 + Expenses:Clothing $2.96 $200.91 + Expenses:Food $19.90 $220.81 + Expenses:Food:Dining $78.32 $299.13 + Expenses:Food:Grocery $67.97 $367.10 + Expenses:Home $1,863.44 $2,230.54 + Expenses:Home:Supplies $38.90 $2,269.44 + Expenses:Movies $5.97 $2,275.41 + Expenses:Supplies $3.84 $2,279.25 + Expenses:Taxes:Sales $169.44 $2,448.69 + Expenses:Tips $11.85 $2,460.54 + Liabilities:MasterCard $-2,460.54 0 +11-May-29 - 11-May-31 Expenses:Cash $-97.00 $-97.00 + Expenses:Food:Dining $6.90 $-90.10 + Expenses:Food:Grocery $157.64 $67.54 + Expenses:Home $108.13 $175.67 + Expenses:Supplies $17.98 $193.65 + Expenses:Taxes:Sales $15.10 $208.75 + Expenses:Tips $97.00 $305.75 + Liabilities:MasterCard $-305.75 0 +end test + +test reg -p "may 2011" --weekly --exact +11-May-01 - 11-May-01 Expe:Computer:Internet $16.10 $16.10 + Liabilities:MasterCard $-16.10 0 +11-May-18 - 11-May-20 Expe:Computer:Internet $30.00 $30.00 + Expe:Computer:Software $6.99 $36.99 + Expenses:Taxes:Sales $0.49 $37.48 + Liabilities:MasterCard $-37.48 0 +11-May-26 - 11-May-28 Expenses:Auto:Gas $70.20 $70.20 + Expenses:Beauty $18.91 $89.11 + Expenses:Bedding $108.84 $197.95 + Expenses:Clothing $2.96 $200.91 + Expenses:Food $19.90 $220.81 + Expenses:Food:Dining $78.32 $299.13 + Expenses:Food:Grocery $67.97 $367.10 + Expenses:Home $1,863.44 $2,230.54 + Expenses:Home:Supplies $38.90 $2,269.44 + Expenses:Movies $5.97 $2,275.41 + Expenses:Supplies $3.84 $2,279.25 + Expenses:Taxes:Sales $169.44 $2,448.69 + Expenses:Tips $11.85 $2,460.54 + Liabilities:MasterCard $-2,460.54 0 +11-May-29 - 11-May-31 Expenses:Cash $-97.00 $-97.00 + Expenses:Food:Dining $6.90 $-90.10 + Expenses:Food:Grocery $157.64 $67.54 + Expenses:Home $108.13 $175.67 + Expenses:Supplies $17.98 $193.65 + Expenses:Taxes:Sales $15.10 $208.75 + Expenses:Tips $97.00 $305.75 + Liabilities:MasterCard $-305.75 0 +end test + +test reg -p "may 2011" --weekly --empty +11-May-01 - 11-May-07 Expe:Computer:Internet $16.10 $16.10 + Liabilities:MasterCard $-16.10 0 +11-May-08 - 11-May-14 <None> 0 0 +11-May-15 - 11-May-21 Expe:Computer:Internet $30.00 $30.00 + Expe:Computer:Software $6.99 $36.99 + Expenses:Taxes:Sales $0.49 $37.48 + Liabilities:MasterCard $-37.48 0 +11-May-22 - 11-May-28 Expenses:Auto:Gas $70.20 $70.20 + Expenses:Beauty $18.91 $89.11 + Expenses:Bedding $108.84 $197.95 + Expenses:Clothing $2.96 $200.91 + Expenses:Food $19.90 $220.81 + Expenses:Food:Dining $78.32 $299.13 + Expenses:Food:Grocery $67.97 $367.10 + Expenses:Home $1,863.44 $2,230.54 + Expenses:Home:Supplies $38.90 $2,269.44 + Expenses:Movies $5.97 $2,275.41 + Expenses:Supplies $3.84 $2,279.25 + Expenses:Taxes:Sales $169.44 $2,448.69 + Expenses:Tips $11.85 $2,460.54 + Liabilities:MasterCard $-2,460.54 0 +11-May-29 - 11-May-31 Expenses:Cash $-97.00 $-97.00 + Expenses:Food:Dining $6.90 $-90.10 + Expenses:Food:Grocery $157.64 $67.54 + Expenses:Home $108.13 $175.67 + Expenses:Supplies $17.98 $193.65 + Expenses:Taxes:Sales $15.10 $208.75 + Expenses:Tips $97.00 $305.75 + Liabilities:MasterCard $-305.75 0 +end test + +test reg -p "may 2011" --weekly --empty --exact +11-May-01 - 11-May-01 Expe:Computer:Internet $16.10 $16.10 + Liabilities:MasterCard $-16.10 0 +11-May-14 - 11-May-14 <None> 0 0 +11-May-18 - 11-May-20 Expe:Computer:Internet $30.00 $30.00 + Expe:Computer:Software $6.99 $36.99 + Expenses:Taxes:Sales $0.49 $37.48 + Liabilities:MasterCard $-37.48 0 +11-May-26 - 11-May-28 Expenses:Auto:Gas $70.20 $70.20 + Expenses:Beauty $18.91 $89.11 + Expenses:Bedding $108.84 $197.95 + Expenses:Clothing $2.96 $200.91 + Expenses:Food $19.90 $220.81 + Expenses:Food:Dining $78.32 $299.13 + Expenses:Food:Grocery $67.97 $367.10 + Expenses:Home $1,863.44 $2,230.54 + Expenses:Home:Supplies $38.90 $2,269.44 + Expenses:Movies $5.97 $2,275.41 + Expenses:Supplies $3.84 $2,279.25 + Expenses:Taxes:Sales $169.44 $2,448.69 + Expenses:Tips $11.85 $2,460.54 + Liabilities:MasterCard $-2,460.54 0 +11-May-29 - 11-May-31 Expenses:Cash $-97.00 $-97.00 + Expenses:Food:Dining $6.90 $-90.10 + Expenses:Food:Grocery $157.64 $67.54 + Expenses:Home $108.13 $175.67 + Expenses:Supplies $17.98 $193.65 + Expenses:Taxes:Sales $15.10 $208.75 + Expenses:Tips $97.00 $305.75 + Liabilities:MasterCard $-305.75 0 +end test diff --git a/test/regress/F524E251.test b/test/regress/F524E251.test new file mode 100644 index 00000000..d2d2f049 --- /dev/null +++ b/test/regress/F524E251.test @@ -0,0 +1,37 @@ +; Test for: ledger -f doc/sample.dat -n reg' shows $0.00 on first post + += /^Expenses:Books/ + (Liabilities:Taxes) -0.10 + +~ Monthly + Assets:Bank:Checking $500.00 + Income:Salary + +2004/05/01 * Checking balance + Assets:Bank:Checking $1,000.00 + Equity:Opening Balances + +2004/05/01 * Investment balance + Assets:Brokerage 50 AAPL @ $30.00 + Equity:Opening Balances + +2004/05/14 * Pay day + Assets:Bank:Checking $500.00 + Income:Salary + +2004/05/27 Book Store + Expenses:Books $20.00 + Liabilities:MasterCard + +2004/05/27 (100) Credit card company + Liabilities:MasterCard $20.00 + Assets:Bank:Checking + +test -n reg +04-May-01 Investment balance <Total> $-1,500.00 + 50 AAPL $-1,500.00 + 50 AAPL +04-May-27 Book Store <Total> $-2.00 $-1,502.00 + 50 AAPL +end test + diff --git a/test/regress/FCE11C8D.test b/test/regress/FCE11C8D.test new file mode 100644 index 00000000..595edc2d --- /dev/null +++ b/test/regress/FCE11C8D.test @@ -0,0 +1,7 @@ +2012-03-17 Payee + Expenses:Food $20 + Assets:Cash + +test reg --monthly --invert exp +12-Mar-01 - 12-Mar-31 Expenses:Food $-20 $-20 +end test diff --git a/test/regress/FDFBA165.test b/test/regress/FDFBA165.test new file mode 100644 index 00000000..55074bed --- /dev/null +++ b/test/regress/FDFBA165.test @@ -0,0 +1,23 @@ +; Test for: automated transactions didn't show up in the balance report + += Income:Clients: + (Liabilities:Taxes:VAT) ((1,00 / 1,19) * 0,19) + +2009/07/27 * Invoice + Assets:Bank:Checking €1.190,00 + Income:Clients:ACME_Inc + +test --decimal-comma bal + €1.190,00 Assets:Bank:Checking + €-1.190,00 Income:Clients:ACME_Inc + €-190,00 Liabilities:Taxes:VAT +-------------------- + €-190,00 +end test + +test --decimal-comma reg +09-Jul-27 Invoice Assets:Bank:Checking €1.190,00 €1.190,00 + Incom:Clients:ACME_Inc €-1.190,00 0 + (Liabilitie:Taxes:VAT) €-190,00 €-190,00 +end test + |