Add more baseline tests.

This commit is contained in:
Martin Michlmayr 2012-03-25 20:26:18 +01:00
parent 4d0daf77d7
commit 86d5858444
6 changed files with 139 additions and 1 deletions

View file

@ -5,8 +5,9 @@ commodity $
format $1,000.00
account Assets:Cash
assert abs(amount) <= 20
check abs(amount) <= 20
check commodity == '$'
default
account Expenses:Food
alias food
@ -20,9 +21,25 @@ account Expenses:Food
food $20.00
Assets:Cash
2012-02-29 KFC
food $25.00
Assets:Cash
2012-02-29 KFC
food $25.00
Assets:Cash
test reg
12-Feb-27 KFC Expenses:Food $20.00 $20.00
Assets:Cash $-20.00 0
12-Feb-28 KFC Expenses:Food $20.00 $20.00
Assets:Cash $-20.00 0
12-Feb-29 KFC Expenses:Food $25.00 $25.00
Assets:Cash $-25.00 0
12-Feb-29 KFC Expenses:Food $25.00 $25.00
Assets:Cash $-25.00 0
__ERROR__
Warning: "$FILE", line 26: Transaction check failed: (abs(amount) <= {20})
Warning: "$FILE", line 30: Transaction check failed: (abs(amount) <= {20})
end test

View file

@ -0,0 +1,21 @@
account A
account B
commodity GBP
2012-03-25 GBP
A 10.00 GBP
B
2012-03-26 EUR
A 20.00 EUR
B
test bal --pedantic -> 1
__ERROR__
While parsing file "$FILE", line 10:
While parsing posting:
A 20.00 EUR
^^^^^^^^^
Error: Unknown commodity 'EUR'
end test

View file

@ -0,0 +1,12 @@
payee KFC
alias Kentucky Fried Chicken
2012-03-25 * Kentucky Fried Chicken
A 10
B
test reg
12-Mar-25 KFC A 10 10
B -10 0
end test

View file

@ -0,0 +1,37 @@
account Assets:Cash
account Expenses:Phone
account Expenses:Rent
account Expenses:Food
commodity EUR
commodity GBP
payee Phone
tag food
2012-03-20 Phone
Expenses:Phone 20.00 GBP
Assets:Cash
2012-03-21 Rent
Expenses:Rent 550.00 GBP
Assets:Cash
2012-03-22 Food
; :food:
Expenses:Food 20.00 EUR
Assets:Cash
test bal --explicit --strict --check-payees
-20.00 EUR
-570.00 GBP Assets:Cash
20.00 EUR
570.00 GBP Expenses
20.00 EUR Food
20.00 GBP Phone
550.00 GBP Rent
--------------------
0
__ERROR__
Warning: "$FILE", line 14: Unknown payee 'Rent'
Warning: "$FILE", line 18: Unknown payee 'Food'
end test

View file

@ -0,0 +1,34 @@
account Assets:Cash
account Expenses:Phone
account Expenses:Rent
commodity GBP
2012-03-20 Phone
Expenses:Phone 20.00 GBP
Assets:Cash
2012-03-21 Rent
Expenses:Rent 550.00 GBP
Assets:Cash
2012-03-22 Food
; :food:
Expenses:Food 20.00 EUR
Assets:Cash
test bal --explicit --strict
-20.00 EUR
-570.00 GBP Assets:Cash
20.00 EUR
570.00 GBP Expenses
20.00 EUR Food
20.00 GBP Phone
550.00 GBP Rent
--------------------
0
__ERROR__
Warning: "$FILE", line 16: Unknown account 'Expenses:Food'
Warning: "$FILE", line 16: Unknown commodity 'EUR'
Warning: "$FILE", line 17: Unknown metadata tag 'food'
end test

View file

@ -0,0 +1,17 @@
2012-03-20 Test GBP
Expenses:Phone 20.00 GBP
Assets:Cash
2012-03-21 * Test GBP
Expenses:Phone 20.00 GBP
Assets:Cash
test bal --pedantic -> 1
__ERROR__
While parsing file "$FILE", line 2:
While parsing posting:
Expenses:Phone 20.00 GBP
Error: Unknown account 'Expenses:Phone'
end test