summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CMakeLists.txt4
-rw-r--r--test/python/JournalTest.py18
-rw-r--r--test/regress/1187_5.test36
-rw-r--r--test/regress/1703.test11
-rw-r--r--test/regress/1722.test12
-rw-r--r--test/regress/1723.test5
-rw-r--r--test/regress/25A099C9.dat (renamed from test/garbage-input.dat)0
-rw-r--r--test/regress/25A099C9.test60
-rw-r--r--test/unit/CMakeLists.txt3
9 files changed, 112 insertions, 37 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index d0b62f6e..41eecb36 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -27,8 +27,6 @@ macro(add_ledger_harness_tests _class)
${TestFile} ${TEST_PYTHON_FLAGS})
set_tests_properties(${_class}Test_${TestFile_Name}
PROPERTIES ENVIRONMENT "TZ=${Ledger_TEST_TIMEZONE}")
- set_target_properties(check
- PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
endif()
endforeach()
endif()
@@ -48,8 +46,6 @@ if (PYTHONINTERP_FOUND)
--ledger $<TARGET_FILE:ledger> --file ${TestFile})
set_tests_properties(${_class}Test_${TestFile_Name}
PROPERTIES ENVIRONMENT "TZ=${Ledger_TEST_TIMEZONE}")
- set_target_properties(check
- PROPERTIES DEPENDS ${_class}Test_${TestFile_Name})
endforeach()
# CheckManpage and CheckTexinfo are disabled, since they do not work
diff --git a/test/python/JournalTest.py b/test/python/JournalTest.py
index e65c671d..2565ede8 100644
--- a/test/python/JournalTest.py
+++ b/test/python/JournalTest.py
@@ -22,6 +22,24 @@ class JournalTestCase(unittest.TestCase):
for post in journal.query("food"):
self.assertEqual(str(post.account), "Expenses:Food")
self.assertEqual(post.amount, Amount("$21.34"))
+
+ def testParseError(self):
+ # TODO: ledger spits out parse errors to standard out.
+ # This should not happen, especially when the error
+ # has already been captured by a Python exception.
+ def fun():
+ read_journal_from_string("""
+2012-03-01 KFC
+ Expenses:Food rsnetnirsnti
+ Assets:Cash
+""")
+ self.assertRaises(RuntimeError, fun)
+ try:
+ fun()
+ except RuntimeError as e:
+ self.assertEquals(str(e).splitlines()[-1],
+ "No quantity specified for amount")
+
def suite():
return unittest.TestLoader().loadTestsFromTestCase(JournalTestCase)
diff --git a/test/regress/1187_5.test b/test/regress/1187_5.test
new file mode 100644
index 00000000..4aa5fdd8
--- /dev/null
+++ b/test/regress/1187_5.test
@@ -0,0 +1,36 @@
+2013/12/01 * Initial State
+ Crédit:Viseca:MasterCard P1 -618.50 CHF
+ Crédit:Viseca:MasterCard P2 -52.10 CHF
+ Equity:Opening Balances
+
+2013/12/15 * Buy Some Chocolate
+ Dépenses:Nourriture 19.00 EUR ; #1
+ Crédit:Viseca:MasterCard P1
+
+2013/12/15 * Buy Some Chocolate
+ Crédit:Viseca:MasterCard P1 18.00 EUR ; #2
+ Recettes:Erreurs
+
+2013/12/23 * Facture Viseca
+ Crédit:Viseca:MasterCard P2 52.10 CHF = 0 ; #3
+ Crédit:Viseca:MasterCard P1 618.50 CHF = 0 CHF ; #4
+ Dépenses:Frais:Gestion Comptes 1.50 CHF
+ Crédit:Viseca -672.10 CHF
+
+2014/01/03 * Facture Viseca
+ Crédit:Viseca 672.10 CHF = 0
+ Actif:Comptes:CP courant
+
+test bal
+ -672.10 CHF Actif:Comptes:CP courant
+ -1.00 EUR Crédit:Viseca
+ -1.00 EUR MasterCard P1
+ 1.50 CHF
+ 19.00 EUR Dépenses
+ 1.50 CHF Frais:Gestion Comptes
+ 19.00 EUR Nourriture
+ 670.60 CHF Equity:Opening Balances
+ -18.00 EUR Recettes:Erreurs
+--------------------
+ 0
+end test
diff --git a/test/regress/1703.test b/test/regress/1703.test
new file mode 100644
index 00000000..983b79be
--- /dev/null
+++ b/test/regress/1703.test
@@ -0,0 +1,11 @@
+
+P 2018-10-31 MultifundosPlus R$0
+
+2017-05-03 * Test
+ Assets:A 1 AAA @ R$ 3000
+ Assets:B
+
+test reg assets:a -V --now 2018-12-31
+17-May-03 Test Assets:A R$3000 R$3000
+end test
+
diff --git a/test/regress/1722.test b/test/regress/1722.test
new file mode 100644
index 00000000..432a19b2
--- /dev/null
+++ b/test/regress/1722.test
@@ -0,0 +1,12 @@
+
+2003/12/20 Organic Co-op
+ Expenses:Food:Groceries $ 37.50 ; ] [=2004/01/01]
+ Assets:Cash $-37.50
+
+test bal
+ $ -37.50 Assets:Cash
+ $ 37.50 Expenses:Food:Groceries
+--------------------
+ 0
+end test
+
diff --git a/test/regress/1723.test b/test/regress/1723.test
new file mode 100644
index 00000000..62a50386
--- /dev/null
+++ b/test/regress/1723.test
@@ -0,0 +1,5 @@
+2017/3/17 deferred posting
+ <deferred posting>
+
+test reg
+end test
diff --git a/test/garbage-input.dat b/test/regress/25A099C9.dat
index 1b7d2101..1b7d2101 100644
--- a/test/garbage-input.dat
+++ b/test/regress/25A099C9.dat
diff --git a/test/regress/25A099C9.test b/test/regress/25A099C9.test
index cfc0eabd..36776520 100644
--- a/test/regress/25A099C9.test
+++ b/test/regress/25A099C9.test
@@ -1,61 +1,61 @@
-test -f test/garbage-input.dat reg -> 29
+test -f test/regress/25A099C9.dat reg -> 29
__ERROR__
-While parsing file "$sourcepath/test/garbage-input.dat", line 1:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 1:
Error: Directive '/*' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 32:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 32:
Error: Directive '/**' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 36:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 36:
Error: Directive '/**' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 66:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 66:
Error: No quantity specified for amount
-While parsing file "$sourcepath/test/garbage-input.dat", line 69:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 69:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/test/garbage-input.dat", line 78:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 78:
Error: Directive '};' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 82:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 82:
Error: Directive '/**' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 93:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 93:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/test/garbage-input.dat", line 97:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 97:
Error: Directive '{' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 98:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 98:
Error: Directive 'public:' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 120:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 120:
Error: Directive 'protected:' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 131:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 131:
Error: Directive 'public:' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 711:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 711:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/test/garbage-input.dat", line 740:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 740:
Error: Directive 'private:' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 749:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 749:
Error: Unexpected whitespace at beginning of line
-While parsing file "$sourcepath/test/garbage-input.dat", line 750:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 750:
Error: Directive '};' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 752:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 752:
Error: Invalid date/time: line amount_t amoun
-While parsing file "$sourcepath/test/garbage-input.dat", line 756:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 756:
Error: Directive '}' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 758:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 758:
Error: Invalid date/time: line string amount_
-While parsing file "$sourcepath/test/garbage-input.dat", line 762:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 762:
Error: Directive '}' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 764:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 764:
Error: Invalid date/time: line string amount_
-While parsing file "$sourcepath/test/garbage-input.dat", line 768:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 768:
Error: Directive '}' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 770:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 770:
Error: Invalid date/time: line string amount_
-While parsing file "$sourcepath/test/garbage-input.dat", line 774:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 774:
Error: Directive '}' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 776:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 776:
Error: Invalid date/time: line std::ostream&
-While parsing file "$sourcepath/test/garbage-input.dat", line 782:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 782:
Error: Directive '}' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 783:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 783:
Error: Invalid date/time: line std::istream&
-While parsing file "$sourcepath/test/garbage-input.dat", line 786:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 786:
Error: Directive '}' requires an argument
-While parsing file "$sourcepath/test/garbage-input.dat", line 789:
+While parsing file "$sourcepath/test/regress/25A099C9.dat", line 789:
Error: Unexpected whitespace at beginning of line
end test
diff --git a/test/unit/CMakeLists.txt b/test/unit/CMakeLists.txt
index 9cacb4e7..3611b00a 100644
--- a/test/unit/CMakeLists.txt
+++ b/test/unit/CMakeLists.txt
@@ -20,7 +20,4 @@ if (BUILD_LIBRARY)
target_link_libraries(MathTests ${PYTHON_LIBRARIES})
endif()
add_ledger_test(MathTests)
-
- set_target_properties(check PROPERTIES DEPENDS LedgerUtilTests)
- set_target_properties(check PROPERTIES DEPENDS LedgerMathTests)
endif()