summaryrefslogtreecommitdiff
path: root/test/regress
diff options
context:
space:
mode:
Diffstat (limited to 'test/regress')
-rw-r--r--test/regress/0161EB1E.test15
-rw-r--r--test/regress/25A099C9.test42
-rw-r--r--test/regress/BF3C1F82-2.test12
-rw-r--r--test/regress/BF3C1F82.test19
-rw-r--r--test/regress/CAE63F5C-a.test17
-rw-r--r--test/regress/CAE63F5C-b.test15
-rw-r--r--test/regress/CAE63F5C-c.test15
-rw-r--r--test/regress/CMakeLists.txt20
-rw-r--r--test/regress/xact_code.dat3
-rw-r--r--test/regress/xact_code.py4
-rw-r--r--test/regress/xact_code_py.test3
11 files changed, 125 insertions, 40 deletions
diff --git a/test/regress/0161EB1E.test b/test/regress/0161EB1E.test
new file mode 100644
index 00000000..93498ad5
--- /dev/null
+++ b/test/regress/0161EB1E.test
@@ -0,0 +1,15 @@
+bucket Assets:Checking
+2011/04/25 Tom's Used Cars
+ Auto $ 5,500.00
+ ; :nobudget:
+
+A Assets:Checking
+2011/04/27 Book Store
+ Books $20.00
+
+test reg
+11-Apr-25 Tom's Used Cars Auto $ 5,500.00 $ 5,500.00
+ Assets:Checking $ -5,500.00 0
+11-Apr-27 Book Store Books $ 20.00 $ 20.00
+ Assets:Checking $ -20.00 0
+end test
diff --git a/test/regress/25A099C9.test b/test/regress/25A099C9.test
index 1ef5ebef..e511c799 100644
--- a/test/regress/25A099C9.test
+++ b/test/regress/25A099C9.test
@@ -1,43 +1,43 @@
-test -f src/amount.h reg -> 20
+test -f test/garbage-input.dat reg -> 20
__ERROR__
-While parsing file "src/amount.h", line 2:
+While parsing file "$sourcepath/test/garbage-input.dat", line 2:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 33:
+While parsing file "$sourcepath/test/garbage-input.dat", line 33:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 37:
+While parsing file "$sourcepath/test/garbage-input.dat", line 37:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 66:
+While parsing file "$sourcepath/test/garbage-input.dat", line 66:
Error: No quantity specified for amount
-While parsing file "src/amount.h", line 69:
+While parsing file "$sourcepath/test/garbage-input.dat", line 69:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 83:
+While parsing file "$sourcepath/test/garbage-input.dat", line 83:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 93:
+While parsing file "$sourcepath/test/garbage-input.dat", line 93:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 99:
+While parsing file "$sourcepath/test/garbage-input.dat", line 99:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 121:
+While parsing file "$sourcepath/test/garbage-input.dat", line 121:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 132:
+While parsing file "$sourcepath/test/garbage-input.dat", line 132:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 702:
+While parsing file "$sourcepath/test/garbage-input.dat", line 711:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 732:
+While parsing file "$sourcepath/test/garbage-input.dat", line 741:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 740:
+While parsing file "$sourcepath/test/garbage-input.dat", line 749:
Error: Unexpected whitespace at beginning of line
-While parsing file "src/amount.h", line 743:
+While parsing file "$sourcepath/test/garbage-input.dat", line 752:
Error: Invalid date/time: line amount_t amoun
-While parsing file "src/amount.h", line 749:
+While parsing file "$sourcepath/test/garbage-input.dat", line 758:
Error: Invalid date/time: line string amount_
-While parsing file "src/amount.h", line 755:
+While parsing file "$sourcepath/test/garbage-input.dat", line 764:
Error: Invalid date/time: line string amount_
-While parsing file "src/amount.h", line 761:
+While parsing file "$sourcepath/test/garbage-input.dat", line 770:
Error: Invalid date/time: line string amount_
-While parsing file "src/amount.h", line 767:
+While parsing file "$sourcepath/test/garbage-input.dat", line 776:
Error: Invalid date/time: line std::ostream&
-While parsing file "src/amount.h", line 774:
+While parsing file "$sourcepath/test/garbage-input.dat", line 783:
Error: Invalid date/time: line std::istream&
-While parsing file "src/amount.h", line 780:
+While parsing file "$sourcepath/test/garbage-input.dat", line 789:
Error: Unexpected whitespace at beginning of line
end test
diff --git a/test/regress/BF3C1F82-2.test b/test/regress/BF3C1F82-2.test
new file mode 100644
index 00000000..453151ce
--- /dev/null
+++ b/test/regress/BF3C1F82-2.test
@@ -0,0 +1,12 @@
+; Check that include directives are relative for "-f /dev/stdin"
+include non-existent-ledger-file-BF3C1F82
+test -f - reg -> 1
+__ERROR__
+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:
+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
new file mode 100644
index 00000000..50f4106f
--- /dev/null
+++ b/test/regress/BF3C1F82.test
@@ -0,0 +1,19 @@
+; Check that error reporting works for "-f -"
+
+2012/02/30 * Test
+ a 1
+ b
+test -f - reg -> 1
+__ERROR__
+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 transaction:
+<no source context>
+Error: Day of month is not valid for year
+end test
diff --git a/test/regress/CAE63F5C-a.test b/test/regress/CAE63F5C-a.test
new file mode 100644
index 00000000..4465bd2f
--- /dev/null
+++ b/test/regress/CAE63F5C-a.test
@@ -0,0 +1,17 @@
+2011/03/01 test1
+ a 4.00 €
+ b
+
+2011/03/02 test2
+ a 4.00 €
+ b
+
+2011/03/03 test2
+ a 4.00 €
+ b
+
+test reg a
+11-Mar-01 test1 a 4.00 € 4.00 €
+11-Mar-02 test2 a 4.00 € 8.00 €
+11-Mar-03 test2 a 4.00 € 12.00 €
+end test
diff --git a/test/regress/CAE63F5C-b.test b/test/regress/CAE63F5C-b.test
new file mode 100644
index 00000000..c0b7efd8
--- /dev/null
+++ b/test/regress/CAE63F5C-b.test
@@ -0,0 +1,15 @@
+2012/08/22 Payment
+ Accrued €208.00 {=$1.3109} @ $1.2799
+ Expenses €4.16 {=$1.2798689} @ $1.2799
+ Assets $-271.54
+ Income:Currency Conversion $-6.45
+
+test bal -X $
+ $272.67 Accrued
+ $-271.54 Assets
+ $6.45 Equity:Capital Gains
+ $5.32 Expenses
+ $-6.45 Income:Currency Conversion
+--------------------
+ $6.45
+end test
diff --git a/test/regress/CAE63F5C-c.test b/test/regress/CAE63F5C-c.test
new file mode 100644
index 00000000..ae2d7d10
--- /dev/null
+++ b/test/regress/CAE63F5C-c.test
@@ -0,0 +1,15 @@
+2012/08/22 Payment
+ Accrued €208.00 {=$1.3109} @ $1.2798689
+ Expenses €4.16 {=$1.2798689} @ $1.2798689
+ Assets $-271.54
+ Income:Currency Conversion $-6.45
+
+test bal -X $
+ $272.67 Accrued
+ $-271.54 Assets
+ $6.45 Equity:Capital Gains
+ $5.32 Expenses
+ $-6.45 Income:Currency Conversion
+--------------------
+ $6.45
+end test
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt
index 4b6232dd..26f55e84 100644
--- a/test/regress/CMakeLists.txt
+++ b/test/regress/CMakeLists.txt
@@ -1,19 +1 @@
-if(HAVE_BOOST_PYTHON)
- set(TEST_PYTHON_FLAGS "--python")
-endif()
-
-if(PYTHONINTERP_FOUND)
- file(GLOB REGRESSION_TESTS *.test)
- foreach(TestFile ${REGRESSION_TESTS})
- get_filename_component(TestFile_Name ${TestFile} NAME_WE)
- string(FIND ${TestFile_Name} "_py" TestFile_IsPythonTest)
- if((NOT TestFile_IsPythonTest) OR HAVE_BOOST_PYTHON)
- add_test(RegressionTest_${TestFile_Name}
- ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/test/RegressTests.py
- ${LEDGER_LOCATION} ${PROJECT_SOURCE_DIR}
- ${TestFile} ${TEST_PYTHON_FLAGS})
- set_target_properties(check
- PROPERTIES DEPENDS RegressionTest_${TestFile_Name})
- endif()
- endforeach()
-endif()
+add_ledger_harness_tests(Regress)
diff --git a/test/regress/xact_code.dat b/test/regress/xact_code.dat
new file mode 100644
index 00000000..60956a23
--- /dev/null
+++ b/test/regress/xact_code.dat
@@ -0,0 +1,3 @@
+2012-11-10 (C0-d3) Payee
+ Assets:Checking € -12,45
+ Expenses:Expenditure
diff --git a/test/regress/xact_code.py b/test/regress/xact_code.py
new file mode 100644
index 00000000..64abb17d
--- /dev/null
+++ b/test/regress/xact_code.py
@@ -0,0 +1,4 @@
+import ledger
+
+for post in ledger.read_journal('test/regress/xact_code.dat').query('expenses'):
+ print post.xact.code
diff --git a/test/regress/xact_code_py.test b/test/regress/xact_code_py.test
new file mode 100644
index 00000000..c22158e0
--- /dev/null
+++ b/test/regress/xact_code_py.test
@@ -0,0 +1,3 @@
+test python test/regress/xact_code.py
+C0-d3
+end test