summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/regress/10D19C11.test37
-rw-r--r--test/regress/178501DC.test21
-rw-r--r--test/regress/3AAB00ED.test23
-rw-r--r--test/regress/53BCED29.test29
-rw-r--r--test/regress/82763D86.test35
-rw-r--r--test/regress/AFAFB804.test57
-rw-r--r--test/regress/C927CFFE.test43
-rw-r--r--test/regress/D9C8EB08.test16
-rw-r--r--test/regress/F524E251.test37
9 files changed, 298 insertions, 0 deletions
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/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/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/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/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/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/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/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/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
+