diff options
Diffstat (limited to 'test/baseline')
-rw-r--r-- | test/baseline/dir-account.test | 19 | ||||
-rw-r--r-- | test/baseline/dir-commodity.test | 21 | ||||
-rw-r--r-- | test/baseline/dir-payee.test | 12 | ||||
-rw-r--r-- | test/baseline/opt-check-payees.test | 37 | ||||
-rw-r--r-- | test/baseline/opt-explicit.test | 34 | ||||
-rw-r--r-- | test/baseline/opt-pedantic.test | 17 |
6 files changed, 139 insertions, 1 deletions
diff --git a/test/baseline/dir-account.test b/test/baseline/dir-account.test index 39831663..e8c3fc54 100644 --- a/test/baseline/dir-account.test +++ b/test/baseline/dir-account.test @@ -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 + diff --git a/test/baseline/dir-commodity.test b/test/baseline/dir-commodity.test new file mode 100644 index 00000000..fc925648 --- /dev/null +++ b/test/baseline/dir-commodity.test @@ -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 + diff --git a/test/baseline/dir-payee.test b/test/baseline/dir-payee.test new file mode 100644 index 00000000..b81bbc2b --- /dev/null +++ b/test/baseline/dir-payee.test @@ -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 + diff --git a/test/baseline/opt-check-payees.test b/test/baseline/opt-check-payees.test index e69de29b..923729e7 100644 --- a/test/baseline/opt-check-payees.test +++ b/test/baseline/opt-check-payees.test @@ -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 + diff --git a/test/baseline/opt-explicit.test b/test/baseline/opt-explicit.test index e69de29b..defae179 100644 --- a/test/baseline/opt-explicit.test +++ b/test/baseline/opt-explicit.test @@ -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 + diff --git a/test/baseline/opt-pedantic.test b/test/baseline/opt-pedantic.test index e69de29b..fbb27b84 100644 --- a/test/baseline/opt-pedantic.test +++ b/test/baseline/opt-pedantic.test @@ -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 + |