diff options
Diffstat (limited to 'test/regress')
46 files changed, 1020 insertions, 24 deletions
diff --git a/test/regress/04D86CD0.test b/test/regress/04D86CD0.test new file mode 100644 index 00000000..73d2f887 --- /dev/null +++ b/test/regress/04D86CD0.test @@ -0,0 +1,11 @@ + +; Test for invalid option embedded in journal + +--foo + +test bal -> 1 +__ERROR__ +While parsing file "$FILE", line 4: +Error: Illegal option --foo +end test + diff --git a/test/regress/1036.test b/test/regress/1036.test new file mode 100644 index 00000000..4e639e5b --- /dev/null +++ b/test/regress/1036.test @@ -0,0 +1,80 @@ + +account + +alias + +apply + +assert + +bucket + +check + +commodity + +def + +define + +apply account foo +end + +expr + +eval + +include + +!include + +import + +payee + +tag + +comment +foo bar +end comment + +value + +test source -> 17 +__ERROR__ +While parsing file "$FILE", line 2: +Error: Directive 'account' requires an argument +While parsing file "$FILE", line 4: +Error: Directive 'alias' requires an argument +While parsing file "$FILE", line 6: +Error: Directive 'apply' requires an argument +While parsing file "$FILE", line 8: +Error: Directive 'assert' requires an argument +While parsing file "$FILE", line 10: +Error: Directive 'bucket' requires an argument +While parsing file "$FILE", line 12: +Error: Directive 'check' requires an argument +While parsing file "$FILE", line 14: +Error: Directive 'commodity' requires an argument +While parsing file "$FILE", line 16: +Error: Directive 'def' requires an argument +While parsing file "$FILE", line 18: +Error: Directive 'define' requires an argument +While parsing file "$FILE", line 23: +Error: Directive 'expr' requires an argument +While parsing file "$FILE", line 25: +Error: Directive 'eval' requires an argument +While parsing file "$FILE", line 27: +Error: Directive 'include' requires an argument +While parsing file "$FILE", line 29: +Error: Directive 'include' requires an argument +While parsing file "$FILE", line 31: +Error: Directive 'import' requires an argument +While parsing file "$FILE", line 33: +Error: Directive 'payee' requires an argument +While parsing file "$FILE", line 35: +Error: Directive 'tag' requires an argument +While parsing file "$FILE", line 41: +Error: Directive 'value' requires an argument +end test + diff --git a/test/regress/1038_1.test b/test/regress/1038_1.test new file mode 100644 index 00000000..c833816e --- /dev/null +++ b/test/regress/1038_1.test @@ -0,0 +1,18 @@ +Y2014 + +04/13 Bank + Expenses:Loan $400 + Assets:Cash + +05/13 Bug 1038 Test + Expenses:Some:Account $500 + Assets:Cash + +06/13 Landlord + Expenses:Rent $600 + Assets:Cash + +test reg --now 2014-05-14 -p 'this month' +14-May-13 Bug 1038 Test Expenses:Some:Account $500 $500 + Assets:Cash $-500 0 +end test diff --git a/test/regress/1038_2.test b/test/regress/1038_2.test new file mode 100644 index 00000000..ce0c046d --- /dev/null +++ b/test/regress/1038_2.test @@ -0,0 +1,18 @@ +year 2014 + +04/13 Bank + Expenses:Loan $400 + Assets:Cash + +05/13 Bug 1038 Test + Expenses:Some:Account $500 + Assets:Cash + +06/13 Landlord + Expenses:Rent $600 + Assets:Cash + +test reg --now 2014-05-14 -p 'this month' +14-May-13 Bug 1038 Test Expenses:Some:Account $500 $500 + Assets:Cash $-500 0 +end test diff --git a/test/regress/1038_3.test b/test/regress/1038_3.test new file mode 100644 index 00000000..0e277d71 --- /dev/null +++ b/test/regress/1038_3.test @@ -0,0 +1,20 @@ +apply year 2014 + +04/13 Bank + Expenses:Loan $400 + Assets:Cash + +05/13 Bug 1038 Test + Expenses:Some:Account $500 + Assets:Cash + +06/13 Landlord + Expenses:Rent $600 + Assets:Cash + +end apply + +test reg --now 2014-05-14 -p 'this month' +14-May-13 Bug 1038 Test Expenses:Some:Account $500 $500 + Assets:Cash $-500 0 +end test diff --git a/test/regress/1046.test b/test/regress/1046.test new file mode 100644 index 00000000..60c27783 --- /dev/null +++ b/test/regress/1046.test @@ -0,0 +1,35 @@ + +2014-05-01 * Test 1 + A 1.00 GBP (@) 1.23 EUR + B -1.23 EUR + +2014-05-02 * Test 2 + A 1.00 GBP (@@) 1.23 EUR + B -1.23 EUR + +2014-05-03 * Test 3 + A 1.00 GBP @ 1.23 EUR + B -1.23 EUR + +2014-05-04 * Test 4 + A 1.00 GBP @@ 1.23 EUR + B -1.23 EUR + +test print +2014/05/01 * Test 1 + A 1.00 GBP (@) 1.23 EUR + B -1.23 EUR + +2014/05/02 * Test 2 + A 1.00 GBP (@@) 1.23 EUR + B -1.23 EUR + +2014/05/03 * Test 3 + A 1.00 GBP @ 1.23 EUR + B -1.23 EUR + +2014/05/04 * Test 4 + A 1.00 GBP @@ 1.23 EUR + B -1.23 EUR +end test + diff --git a/test/regress/1050.test b/test/regress/1050.test new file mode 100644 index 00000000..a214e053 --- /dev/null +++ b/test/regress/1050.test @@ -0,0 +1,39 @@ + +D $1000.00 +D £1000.00 +D €1000.00 +D 1000.00 EUR + +2014-06-05 * Test + A 2 EUR @$1.37 + C + +2014-06-05 * Test + A 2 EUR @@£1.62 + C + +2014-06-05 * Test + A 2 EUR (@)€1.00 + C + +2014-06-05 * Test + A 2 EUR (@@)€2.00 + C + +test bal + 8.00 EUR A + $-2.74 + £-1.62 + €-4.00 C +-------------------- + $-2.74 + 8.00 EUR + £-1.62 + €-4.00 +end test + +test pricedb +P 2014/06/05 00:00:00 EUR $1.37 +P 2014/06/05 00:00:00 EUR £0.81 +end test + diff --git a/test/regress/1072.test b/test/regress/1072.test new file mode 100644 index 00000000..3f58b83f --- /dev/null +++ b/test/regress/1072.test @@ -0,0 +1,31 @@ + +--input-date-format %d/%m/%y +--date-format %d/%m/%y + +1/1/14 * Test + A $10 + B + +12/1/14 * Test + A $20 + B + +test --input-date-format %d/%m/%y reg --begin 2/1/13 +01/01/14 Test A $10 $10 + B $-10 0 +12/01/14 Test A $20 $20 + B $-20 0 +end test + +test --input-date-format %d/%m/%y reg --begin 1/1/14 +01/01/14 Test A $10 $10 + B $-10 0 +12/01/14 Test A $20 $20 + B $-20 0 +end test + +test --input-date-format %d/%m/%y reg --begin 2/1/14 +12/01/14 Test A $20 $20 + B $-20 0 +end test + diff --git a/test/regress/1074.test b/test/regress/1074.test new file mode 100644 index 00000000..1aaf0ca0 --- /dev/null +++ b/test/regress/1074.test @@ -0,0 +1,161 @@ + +--input-date-format %Y-%m-%d +--date-format %Y-%m-%d + +2011-06-01 * Jun 2011 + A $10 + B + +2011-07-01 * Jul 2011 + A $10 + B + +2011-08-01 * Aug 2011 + A $10 + B + +2012-06-01 * Jun 2012 + A $10 + B + +2012-07-01 * Jul 2012 + A $10 + B + +2012-08-01 * Aug 2012 + A $10 + B + +2013-06-01 * Jun 2013 + A $10 + B + +2013-07-01 * Jul 2013 + A $10 + B + +2013-08-01 * Aug 2013 + A $10 + B + +2014-06-01 * Jun 2014 + A $10 + B + +2014-07-01 * Jul 2014 + A $10 + B + +2014-08-01 * Aug 2014 + A $10 + B + +2015-06-01 * Jun 2015 + A $10 + B + +2015-07-01 * Jul 2015 + A $10 + B + +2015-08-01 * Aug 2015 + A $10 + B + +test --now 2012-02-03 reg -p "from june to july" +2012-06-01 Jun 2012 A $10 $10 + B $-10 0 +end test + +test --now 2013-02-03 reg -p "from june to july" +2013-06-01 Jun 2013 A $10 $10 + B $-10 0 +end test + +test --now 2014-02-03 reg -p "from june to july" +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + +test --now 2014-10-02 reg -p "from june to july" +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + +test --now 2012-02-03 reg -p "from june to july 2014" +2012-06-01 Jun 2012 A $10 $10 + B $-10 0 +2012-07-01 Jul 2012 A $10 $10 + B $-10 0 +2012-08-01 Aug 2012 A $10 $10 + B $-10 0 +2013-06-01 Jun 2013 A $10 $10 + B $-10 0 +2013-07-01 Jul 2013 A $10 $10 + B $-10 0 +2013-08-01 Aug 2013 A $10 $10 + B $-10 0 +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + +test --now 2013-10-02 reg -p "from june to july 2014" +2013-06-01 Jun 2013 A $10 $10 + B $-10 0 +2013-07-01 Jul 2013 A $10 $10 + B $-10 0 +2013-08-01 Aug 2013 A $10 $10 + B $-10 0 +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + +test --now 2014-01-02 reg -p "from june to july 2014" +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + +test --now 2014-10-02 reg -p "from june to july 2014" +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + +test --now 2012-02-03 reg -p "from june 2012 to july 2014" +2012-06-01 Jun 2012 A $10 $10 + B $-10 0 +2012-07-01 Jul 2012 A $10 $10 + B $-10 0 +2012-08-01 Aug 2012 A $10 $10 + B $-10 0 +2013-06-01 Jun 2013 A $10 $10 + B $-10 0 +2013-07-01 Jul 2013 A $10 $10 + B $-10 0 +2013-08-01 Aug 2013 A $10 $10 + B $-10 0 +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + +test --now 2012-02-03 reg -p "from june 2013 to july 2014" +2013-06-01 Jun 2013 A $10 $10 + B $-10 0 +2013-07-01 Jul 2013 A $10 $10 + B $-10 0 +2013-08-01 Aug 2013 A $10 $10 + B $-10 0 +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + +test --now 2015-02-03 reg -p "from june 2013 to july 2014" +2013-06-01 Jun 2013 A $10 $10 + B $-10 0 +2013-07-01 Jul 2013 A $10 $10 + B $-10 0 +2013-08-01 Aug 2013 A $10 $10 + B $-10 0 +2014-06-01 Jun 2014 A $10 $10 + B $-10 0 +end test + diff --git a/test/regress/15A80F68.test b/test/regress/15A80F68.test index 0b29b82d..4eb66fe7 100644 --- a/test/regress/15A80F68.test +++ b/test/regress/15A80F68.test @@ -6,7 +6,7 @@ test bal -> 1 __ERROR__ -While parsing file "$FILE", line 4: +While parsing file "$FILE", line 4: While parsing posting: A (2 FOO @ 10.00 EUR) = 20.00 EUR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/test/regress/1A546C4D.test b/test/regress/1A546C4D.test index 97adc9de..d6ffb68e 100644 --- a/test/regress/1A546C4D.test +++ b/test/regress/1A546C4D.test @@ -4,7 +4,7 @@ test bal -> 1 __ERROR__ -While parsing file "$FILE", line 2: +While parsing file "$FILE", line 2: While parsing posting: Assets:Cash $1,00.00 ^^^^^^^^ diff --git a/test/regress/2E3496BD.test b/test/regress/2E3496BD.test index 82c7cde7..007bb25f 100644 --- a/test/regress/2E3496BD.test +++ b/test/regress/2E3496BD.test @@ -6,7 +6,7 @@ D 1,000.00 USD test bal -> 1 __ERROR__ -While parsing file "$FILE", line 5: +While parsing file "$FILE", line 5: While balancing transaction from "$FILE", lines 3-5: > 2007-12-31 * Start of year / Opening balances. > Account1 1000 EUR @ 1.6 USD diff --git a/test/regress/375.test b/test/regress/375.test new file mode 100644 index 00000000..84254155 --- /dev/null +++ b/test/regress/375.test @@ -0,0 +1,36 @@ + +2009-01-01 * Jan 09 + Assets:Current 100.00 EUR + Income:Salary + +2009-02-01 * Feb 09 + Assets:Current 100.00 EUR + Income:Salary + +2009-03-01 * Mar 09 + Assets:Current 100.00 EUR + Income:Salary + +2010-01-01 * Jan 10 + Assets:Current 100.00 EUR + Income:Salary + +2010-02-01 * Feb 10 + Assets:Current 100.00 EUR + Income:Salary + +test reg -p "until Feb 2009" +09-Jan-01 Jan 09 Assets:Current 100.00 EUR 100.00 EUR + Income:Salary -100.00 EUR 0 +end test + +test reg -p "until February 2009" +09-Jan-01 Jan 09 Assets:Current 100.00 EUR 100.00 EUR + Income:Salary -100.00 EUR 0 +end test + +test reg -p "in Feb 2009" +09-Feb-01 Feb 09 Assets:Current 100.00 EUR 100.00 EUR + Income:Salary -100.00 EUR 0 +end test + diff --git a/test/regress/383.test b/test/regress/383.test new file mode 100644 index 00000000..ab4372fd --- /dev/null +++ b/test/regress/383.test @@ -0,0 +1,29 @@ + +--input-date-format %Y:%m:%d + +D 1000.00 GBP + +2014:05:12 * Test + Assets:Investments 100 AA {2.00 GBP} [2014:01:01] @@ 200.00 GBP + Equity:Opening balance + +test bal Assets:Investments --lots --date-format %Y.%m.%d +100 AA {2.00 GBP} [2014.01.01] Assets:Investments +end test + +test bal Assets:Investments --lots --date-format %Y/%m/%d +100 AA {2.00 GBP} [2014/01/01] Assets:Investments +end test + +test bal Assets:Investments --lots --date-format %Y:%m:%d +100 AA {2.00 GBP} [2014:01:01] Assets:Investments +end test + +test bal Assets:Investments --lots --date-format %Y-%m-%d +100 AA {2.00 GBP} [2014-01-01] Assets:Investments +end test + +test bal Assets:Investments --lots --date-format %g-%b-%d +100 AA {2.00 GBP} [14-Jan-01] Assets:Investments +end test + diff --git a/test/regress/494-a.ledger b/test/regress/494-a.ledger new file mode 100644 index 00000000..4094f7dc --- /dev/null +++ b/test/regress/494-a.ledger @@ -0,0 +1,10 @@ + +15.03.2006 Exxon + Expenses:Auto:Gas 10,00 € + Liabilities:MasterCard -10,00 € + +test --input-date-format '%d.%m.%Y' reg +06-Mar-15 Exxon Expenses:Auto:Gas 10,00 € 10,00 € + Liabilities:MasterCard -10,00 € 0 +end test + diff --git a/test/regress/494-b.ledger b/test/regress/494-b.ledger new file mode 100644 index 00000000..40e8b1b7 --- /dev/null +++ b/test/regress/494-b.ledger @@ -0,0 +1,17 @@ + +--input-date-format %d.%m + +Y2010 +03.01 * Foo + A 10.00 EUR + B + +05.02 * Bar + A 20.00 EUR + B + +test reg A +10-Jan-03 Foo A 10.00 EUR 10.00 EUR +10-Feb-05 Bar A 20.00 EUR 30.00 EUR +end test + diff --git a/test/regress/5D92A5EB.test b/test/regress/5D92A5EB.test index 1bdd7256..57fcadb3 100644 --- a/test/regress/5D92A5EB.test +++ b/test/regress/5D92A5EB.test @@ -14,7 +14,7 @@ test -J reg checking -> 1 __ERROR__ -While parsing file "$FILE", line 13: +While parsing file "$FILE", line 13: While parsing periodic transaction: > ~ Monthly from 2010/7/1 > Expenses:Auto:Gas $100.00 @@ -29,6 +29,6 @@ While parsing periodic transaction: > Liabilities:Education:ULL $100.00 > Liabilities:Mortgage $100.00 > Assets:Bank:Checking -Error: Posting with null amount's account may be mispelled: +Error: Posting with null amount's account may be misspelled: "Expenses:Entertainment:Blizzard $100.00" end test diff --git a/test/regress/6188B0EC.test b/test/regress/6188B0EC.test index b2aec910..3404fee4 100644 --- a/test/regress/6188B0EC.test +++ b/test/regress/6188B0EC.test @@ -4,7 +4,7 @@ test bal -> 1 __ERROR__ -While parsing file "$FILE", line 3: +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/634AA589.test b/test/regress/634AA589.test new file mode 100644 index 00000000..8f8ff031 --- /dev/null +++ b/test/regress/634AA589.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/regress/6E7C2DF9.test b/test/regress/6E7C2DF9.test new file mode 100644 index 00000000..c55fbdcc --- /dev/null +++ b/test/regress/6E7C2DF9.test @@ -0,0 +1,24 @@ +Y 2010 +10/10 * TwentyTen + Account:Ten $ 10.10 + Assets:Cash + +apply year 2011 +11/11 * TwentyEleven + Account:Eleven $ 11.11 + Assets:Cash + +2012/12/12 * TwentyTwelve + Account:Twelve $ 12.12 + Assets:Cash + +11/11 * TwentyEleven Again + Account:Eleven $ 11.11 + Assets:Cash + +test reg --sort date account +10-Oct-10 TwentyTen Account:Ten $ 10.10 $ 10.10 +11-Nov-11 TwentyEleven Account:Eleven $ 11.11 $ 21.21 +11-Nov-11 TwentyEleven Again Account:Eleven $ 11.11 $ 32.32 +12-Dec-12 TwentyTwelve Account:Twelve $ 12.12 $ 44.44 +end test diff --git a/test/regress/712.test b/test/regress/712-a.test index e0dbfa5a..e0dbfa5a 100644 --- a/test/regress/712.test +++ b/test/regress/712-a.test diff --git a/test/regress/712-b.test b/test/regress/712-b.test new file mode 100644 index 00000000..7f183b5f --- /dev/null +++ b/test/regress/712-b.test @@ -0,0 +1,22 @@ + +2011-01-01 * Opening balance + Assets:Cash 10.00 GBP + Equity:Opening balance -10.00 GBP + +2011-02-01 * Buy 1 AAA for 10.00 GBP + Assets:Investments 1 AAA {10.00 GBP} + Assets:Cash -10.00 GBP + +2011-12-07 * Sell AAA with a gain + Assets:Cash 12.00 GBP + Assets:Investments -1 AAA {10.00 GBP} @@ 12.00 GBP + Income:Capital gains -2.00 GBP + +test bal + 12.00 GBP Assets:Cash + -10.00 GBP Equity:Opening balance + -2.00 GBP Income:Capital gains +-------------------- + 0 +end test + diff --git a/test/regress/713-a.test b/test/regress/713-a.test new file mode 100644 index 00000000..b3953a84 --- /dev/null +++ b/test/regress/713-a.test @@ -0,0 +1,40 @@ + +2011-01-01 * Opening balance + Assets:Cash 25.00 GBP + Equity:Opening balance -25.00 GBP + +2011-02-01 * Buy 1 AAA for 10.00 GBP + Assets:Investments 1 AAA {10.00 GBP} + Assets:Cash -10.00 GBP + +2011-03-07 * Sell one AAA with a gain + Assets:Cash 12.00 GBP + Assets:Investments -1 AAA {10.00 GBP} @@ 12.00 GBP + Income:Capital gains -2.00 GBP + +2011-04-01 * Buy 1 BBB for 15.00 GBP + Assets:Investments 1 BBB {15.00 GBP} + Assets:Cash -15.00 GBP + +test bal -B Assets:Investments -p "until 2011-02-20" + 10.00 GBP Assets:Investments +end test + +test bal -B Assets:Investments -p "until 2011-03-20" +end test + +test bal -B Assets:Investments -p "until 2011-04-20" + 15.00 GBP Assets:Investments +end test + +test bal Assets:Investments -p "until 2011-02-20" + 1 AAA Assets:Investments +end test + +test bal Assets:Investments -p "until 2011-03-20" +end test + +test bal Assets:Investments -p "until 2011-04-20" + 1 BBB Assets:Investments +end test + diff --git a/test/regress/713-b.test b/test/regress/713-b.test new file mode 100644 index 00000000..36685b27 --- /dev/null +++ b/test/regress/713-b.test @@ -0,0 +1,48 @@ + +2014-01-01 * Opening balances + Assets:Cash 100.00 GBP + Equity:Opening balances + +2014-02-01 * Buy 1 AAA for 10 GBP + Assets:Investments 1 AAA @ 10.00 GBP + Assets:Cash -10.00 GBP + +2014-03-01 * Buy 1 AAA for 20 GBP + Assets:Investments 1 AAA @ 20.00 GBP + Assets:Cash -20.00 GBP + +; Let's say the second purchase attracts an equalisation of 2.00 GBP. +; This means that the purchase price from now on should be 18.00 +; rather than 20.00 GBP. So we add a new share with that price and +; the original date, and remove the existing share at the old price; the +; difference of 2.00 GBP is the equalisation received, which is paid to +; the account. +2014-04-16 * Dividend (Equalisation) from AAA + Assets:Investments 1 AAA {18.00 GBP} [2014-03-01] @@ 18.00 GBP + Assets:Investments -1 AAA {20.00 GBP} [2014-03-01] @@ 20.00 GBP + Assets:Broker 2.00 GBP + +test bal -B Assets:Investment -p "until 2014-02-20" + 10.00 GBP Assets:Investments +end test + +test bal -B Assets:Investment -p "until 2014-03-20" + 30.00 GBP Assets:Investments +end test + +test bal -B Assets:Investment -p "until 2014-04-20" + 28.00 GBP Assets:Investments +end test + +test bal Assets:Investment -p "until 2014-02-20" + 1 AAA Assets:Investments +end test + +test bal Assets:Investment -p "until 2014-03-20" + 2 AAA Assets:Investments +end test + +test bal Assets:Investment -p "until 2014-04-20" + 2 AAA Assets:Investments +end test + diff --git a/test/regress/730.test b/test/regress/730.test new file mode 100644 index 00000000..d81a1c22 --- /dev/null +++ b/test/regress/730.test @@ -0,0 +1,37 @@ +; Using -M in combination with an empty result causes a segmentation fault +; therefore this test case does not have or need any test data + +test -f /dev/null -M reg +end test + +; Tests mentioned in #730 +test reg -M +end test + +test reg -M .foo +end test + +test reg -M -e 2012/01 +end test + + +; Tests mentioned in #1080 +test reg '^Expenses' and expr 'any(account =~ /^Assets:Cash/)' --period 'every week this month' +end test + +test bal '^Expenses' and expr 'any(account =~ /^Assets:Cash/)' --period 'every week this month' +end test + +test bal reg foo and expr 'any(account =~ /bar/)' --period 'every week' +end test + + +; Tests mentioned in #1084 +test b abc -M +end test + +test reg foo -M +end test + +test bal foo -M +end test diff --git a/test/regress/755.test b/test/regress/755.test new file mode 100644 index 00000000..9581debc --- /dev/null +++ b/test/regress/755.test @@ -0,0 +1,90 @@ + +; Test backwards compatibility with ledger2 + +--date-format %Y/%m/%d + +2009-04-17 * Test 1 + A 10.00 EUR + B + +2009-04-18=2010-04-20 (110) Test 2 + * C 20.00 EUR ;foo + * B + +test -F "%a\n" reg +A +B +C +B +end test + +test -F "%A\n" reg +A +B +C +B +end test + +test -F "%d\n" reg +2009/04/17 +2009/04/17 +2009/04/18=2010/04/20 +2009/04/18=2010/04/20 +end test + +test -F "%D\n" reg +2009/04/17 +2009/04/17 +2009/04/18 +2009/04/18 +end test + +test -F "%S\n" reg +$FILE +$FILE +$FILE +$FILE +end test + +test -F "%b\n" reg +7 +8 +11 +12 +end test + +test -F "%B\n" reg +90 +126 +168 +209 +end test + +test -F "%X%P\n" reg +* Test 1 +* Test 1 +* Test 2 +* Test 2 +end test + +test -F "%Y%P\n" reg +* Test 1 +* Test 1 +Test 2 +Test 2 +end test + +test -F "%C%P\n" reg +Test 1 +Test 1 +(110) Test 2 +(110) Test 2 +end test + +test -F "%N\n" reg + + +foo + +end test + diff --git a/test/regress/785.test b/test/regress/785.test new file mode 100644 index 00000000..706d7a84 --- /dev/null +++ b/test/regress/785.test @@ -0,0 +1,85 @@ + +account AA + alias + +account BB + default + +account CC + note + +account DD + payee + +account EE + value + +account FF + assert + +account GG + check + +account HH + eval + +account II + expr + +commodity AAA + alias + +commodity BBB + default + +commodity CCC + nomarket + +commodity DDD + value + +commodity EEE + format + +commodity FFF + note + +payee FOO + alias + uuid fooo + +payee BAR + uuid + +test source -> 14 +__ERROR__ +While parsing file "$FILE", line 3: +Error: Account directive 'alias' requires an argument +While parsing file "$FILE", line 9: +Error: Account directive 'note' requires an argument +While parsing file "$FILE", line 12: +Error: Account directive 'payee' requires an argument +While parsing file "$FILE", line 15: +Error: Account directive 'value' requires an argument +While parsing file "$FILE", line 18: +Error: Account directive 'assert' requires an argument +While parsing file "$FILE", line 21: +Error: Account directive 'check' requires an argument +While parsing file "$FILE", line 24: +Error: Account directive 'eval' requires an argument +While parsing file "$FILE", line 27: +Error: Account directive 'expr' requires an argument +While parsing file "$FILE", line 30: +Error: Commodity directive 'alias' requires an argument +While parsing file "$FILE", line 39: +Error: Commodity directive 'value' requires an argument +While parsing file "$FILE", line 42: +Error: Commodity directive 'format' requires an argument +While parsing file "$FILE", line 45: +Error: Commodity directive 'note' requires an argument +While parsing file "$FILE", line 48: +Error: Payee directive 'alias' requires an argument +While parsing file "$FILE", line 52: +Error: Payee directive 'uuid' requires an argument +end test + diff --git a/test/regress/78AB4B87_py.test b/test/regress/78AB4B87_py.test index 8f847145..cbfe9c6a 100644 --- a/test/regress/78AB4B87_py.test +++ b/test/regress/78AB4B87_py.test @@ -5,7 +5,7 @@ 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] +-5.00 EUR {0.8733 GBP} [12-Jan-03] EUR Total is presently: (-5.73 EUR) Converted to EUR: (-5.00 EUR) diff --git a/test/regress/8EAF77C0.test b/test/regress/8EAF77C0.test index f0a2829c..9d63951d 100644 --- a/test/regress/8EAF77C0.test +++ b/test/regress/8EAF77C0.test @@ -12,6 +12,6 @@ test reg -> 1 __ERROR__ -While parsing file "$FILE", line 5: +While parsing file "$FILE", line 5: Error: Unexpected whitespace at beginning of line end test diff --git a/test/regress/9188F587_py.test b/test/regress/9188F587_py.test index 28bb34ff..e431af90 100644 --- a/test/regress/9188F587_py.test +++ b/test/regress/9188F587_py.test @@ -5,7 +5,7 @@ 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] +-5.00 EUR {0.8733 GBP} [12-Jan-03] EUR Total is presently: (-6.00 EUR) Converted to EUR: (-5.00 EUR) diff --git a/test/regress/999-a.test b/test/regress/999-a.test new file mode 100644 index 00000000..9865eeed --- /dev/null +++ b/test/regress/999-a.test @@ -0,0 +1,6 @@ +2012-03-10 My Brother + Assets:Brokerage 1000 AAPL (@) $1 + Income:Gifts Received + +test prices +end test diff --git a/test/regress/999-b.test b/test/regress/999-b.test new file mode 100644 index 00000000..f6d19f30 --- /dev/null +++ b/test/regress/999-b.test @@ -0,0 +1,22 @@ + +2014-01-01 * Test + Assets:Cash 10.00 GBP + Equity:Opening balance -10.00 GBP + +2014-02-01 * Exchange rate 1.10 + Assets:Cash -1.00 GBP @ 1.10 EUR + Assets:Cash 1.10 EUR + +2014-03-01 * Exchange rate 1.20 + Assets:Cash -1.00 GBP (@) 1.20 EUR + Assets:Cash 1.20 EUR + +test pricedb +P 2014/02/01 00:00:00 GBP 1.10 EUR +end test + +test reg Equity:Opening -X EUR +14-Jan-01 Test Equity:Opening balance -10.00 GBP -10.00 GBP +14-Feb-01 Commodities revalued <Revalued> 0 -11.00 EUR +end test + diff --git a/test/regress/A013A73B.test b/test/regress/A013A73B.test new file mode 100644 index 00000000..251277ea --- /dev/null +++ b/test/regress/A013A73B.test @@ -0,0 +1,10 @@ + +2014-01-01 c ; x + a 1 + b + +test reg +14-Jan-01 c a 1 1 + b -1 0 +end test + diff --git a/test/regress/AA2FF2B.test b/test/regress/AA2FF2B.test new file mode 100644 index 00000000..944cdfea --- /dev/null +++ b/test/regress/AA2FF2B.test @@ -0,0 +1,10 @@ +2008/01/20 * La Poste + Revenu:Invest:Exonéré + Actif:Courant:LaPosteLivretA 25,24 € = 25,24 € + +test --args-only --decimal-comma bal + 25,24 € Actif:Courant:LaPosteLivretA + -25,24 € Revenu:Invest:Exonéré +-------------------- + 0 +end test diff --git a/test/regress/BF3C1F82-2.test b/test/regress/BF3C1F82-2.test index 453151ce..94d59e4d 100644 --- a/test/regress/BF3C1F82-2.test +++ b/test/regress/BF3C1F82-2.test @@ -2,11 +2,11 @@ include non-existent-ledger-file-BF3C1F82 test -f - reg -> 1 __ERROR__ -While parsing file "", line 2: +While parsing file "", line 2: Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82" end test test -f /dev/stdin reg -> 1 __ERROR__ -While parsing file "", line 2: +While parsing file "", line 2: Error: File to include was not found: "./non-existent-ledger-file-BF3C1F82" end test diff --git a/test/regress/BF3C1F82.test b/test/regress/BF3C1F82.test index 50f4106f..9d4937bb 100644 --- a/test/regress/BF3C1F82.test +++ b/test/regress/BF3C1F82.test @@ -5,14 +5,14 @@ b test -f - reg -> 1 __ERROR__ -While parsing file "", line 3: +While parsing file "", line 3: While parsing transaction: <no source context> Error: Day of month is not valid for year end test test -f /dev/stdin reg -> 1 __ERROR__ -While parsing file "", line 3: +While parsing file "", line 3: While parsing transaction: <no source context> Error: Day of month is not valid for year diff --git a/test/regress/C0212EAC.test b/test/regress/C0212EAC.test index 9a572ef6..e77107d7 100644 --- a/test/regress/C0212EAC.test +++ b/test/regress/C0212EAC.test @@ -27,7 +27,4 @@ test reg -5.00 GBP {=1.40 EUR} Income:Gain -0.50 EUR 5.00 GBP -5.00 GBP {=1.40 EUR} - Equity:Capital Gains 0.50 EUR 0.50 EUR - 5.00 GBP - -5.00 GBP {=1.40 EUR} end test diff --git a/test/regress/C19E4E9B.test b/test/regress/C19E4E9B.test index 4837b4cd..822e3f0e 100644 --- a/test/regress/C19E4E9B.test +++ b/test/regress/C19E4E9B.test @@ -6,7 +6,7 @@ A 1 AAA @ 2.00 EUR B -2.00 EUR -test reg --format "%S: %d %P %t %T\n" +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 diff --git a/test/regress/CAE63F5C-b.test b/test/regress/CAE63F5C-b.test index c0b7efd8..e1ea049e 100644 --- a/test/regress/CAE63F5C-b.test +++ b/test/regress/CAE63F5C-b.test @@ -7,9 +7,8 @@ test bal -X $ $272.67 Accrued $-271.54 Assets - $6.45 Equity:Capital Gains $5.32 Expenses $-6.45 Income:Currency Conversion -------------------- - $6.45 + 0 end test diff --git a/test/regress/CAE63F5C-c.test b/test/regress/CAE63F5C-c.test index 64728544..db318b2d 100644 --- a/test/regress/CAE63F5C-c.test +++ b/test/regress/CAE63F5C-c.test @@ -7,9 +7,8 @@ test bal -X $ $272.67 Accrued $-271.54 Assets - $6.45 Equity:Capital Gains $5.32 Expenses $-6.45 Income:Currency Conversion -------------------- - $6.46 + 0 end test diff --git a/test/regress/D51BFF74.test b/test/regress/D51BFF74.test index a13af897..08ed7a8e 100644 --- a/test/regress/D51BFF74.test +++ b/test/regress/D51BFF74.test @@ -16,7 +16,7 @@ test reg -> 1 __ERROR__ -While parsing file "$FILE", line 6: +While parsing file "$FILE", line 6: While parsing posting: Expenses:Food $- 20 ^^^^^ diff --git a/test/regress/D9C8EB08.test b/test/regress/D9C8EB08.test index fa02431b..eb4952ba 100644 --- a/test/regress/D9C8EB08.test +++ b/test/regress/D9C8EB08.test @@ -10,7 +10,7 @@ test bal -> 1 __ERROR__ -While parsing file "$FILE", line 9: +While parsing file "$FILE", line 9: Error: 'end' or 'end apply' found, but no enclosing 'apply' directive end test diff --git a/test/regress/DDB54BB8.test b/test/regress/DDB54BB8.test index 7d72043c..29b32151 100644 --- a/test/regress/DDB54BB8.test +++ b/test/regress/DDB54BB8.test @@ -4,7 +4,7 @@ test bal -> 1 __ERROR__ -While parsing file "$FILE", line 3: +While parsing file "$FILE", line 3: Unbalanced remainder is: -0,10€ Amount to balance against: diff --git a/test/regress/DE17CCF1.test b/test/regress/DE17CCF1.test new file mode 100644 index 00000000..00d4184b --- /dev/null +++ b/test/regress/DE17CCF1.test @@ -0,0 +1,61 @@ + +--date-format %Y-%m-%d + +2014-06-30 Uncleared + U:U 10.00 EUR + ! U:P 10.00 EUR + * U:C 10.00 EUR + Equity -30.00 EUR + +2014-06-30 ! Pending + P:U 10.00 EUR + ! P:P 10.00 EUR + * P:C 10.00 EUR + Equity -30.00 EUR + +2014-06-30 * Cleared + C:C 10.00 EUR + ! C:P 10.00 EUR + * C:P 10.00 EUR + Equity -30.00 EUR + +test reg u: --uncleared +2014-06-30 Uncleared U:U 10.00 EUR 10.00 EUR + U:P 10.00 EUR 20.00 EUR +end test + +test reg u: --pending +2014-06-30 Uncleared U:P 10.00 EUR 10.00 EUR +end test + +test reg u: --cleared +2014-06-30 Uncleared U:C 10.00 EUR 10.00 EUR +end test + +test reg p: --uncleared +2014-06-30 Pending P:U 10.00 EUR 10.00 EUR + P:P 10.00 EUR 20.00 EUR +end test + +test reg p: --pending +2014-06-30 Pending P:U 10.00 EUR 10.00 EUR + P:P 10.00 EUR 20.00 EUR +end test + +test reg p: --cleared +2014-06-30 Pending P:C 10.00 EUR 10.00 EUR +end test + +test reg c: --uncleared +2014-06-30 Cleared C:P 10.00 EUR 10.00 EUR +end test + +test reg c: --pending +2014-06-30 Cleared C:P 10.00 EUR 10.00 EUR +end test + +test reg c: --cleared +2014-06-30 Cleared C:C 10.00 EUR 10.00 EUR + C:P 10.00 EUR 20.00 EUR +end test + diff --git a/test/regress/error-in-include.dat b/test/regress/error-in-include.dat new file mode 100644 index 00000000..9f654a42 --- /dev/null +++ b/test/regress/error-in-include.dat @@ -0,0 +1,5 @@ + +2014-05-13 * Does not balance + A $10.00 + B -$11.00 + diff --git a/test/regress/error-in-include.test b/test/regress/error-in-include.test new file mode 100644 index 00000000..10d8d1da --- /dev/null +++ b/test/regress/error-in-include.test @@ -0,0 +1,17 @@ + +!include error-in-include.dat + +test bal -> 1 +__ERROR__ +In file included from "$FILE", line 2: +While parsing file "$sourcepath/test/regress/error-in-include.dat", line 4: +While balancing transaction from "$sourcepath/test/regress/error-in-include.dat", lines 2-4: +> 2014-05-13 * Does not balance +> A $10.00 +> B -$11.00 +Unbalanced remainder is: + $-1.00 +Amount to balance against: + $10.00 +Error: Transaction does not balance +end test |