diff options
Diffstat (limited to 'test/regress')
-rw-r--r-- | test/regress/0DDDEBC0.dat | 3 | ||||
-rw-r--r-- | test/regress/0DDDEBC0.test | 9 | ||||
-rw-r--r-- | test/regress/25A099C9.test | 20 | ||||
-rw-r--r-- | test/regress/68917252.dat | 2 | ||||
-rw-r--r-- | test/regress/68917252.test | 5 | ||||
-rw-r--r-- | test/regress/A3FA7601.dat | 3 | ||||
-rw-r--r-- | test/regress/A3FA7601.test | 9 | ||||
-rw-r--r-- | test/regress/BF3C1F82-2.test | 12 | ||||
-rw-r--r-- | test/regress/BF3C1F82.test | 19 | ||||
-rw-r--r-- | test/regress/CMakeLists.txt | 20 | ||||
-rw-r--r-- | test/regress/xact_code.dat | 3 | ||||
-rw-r--r-- | test/regress/xact_code.py | 4 | ||||
-rw-r--r-- | test/regress/xact_code_py.test | 3 |
13 files changed, 83 insertions, 29 deletions
diff --git a/test/regress/0DDDEBC0.dat b/test/regress/0DDDEBC0.dat new file mode 100644 index 00000000..21b6fce1 --- /dev/null +++ b/test/regress/0DDDEBC0.dat @@ -0,0 +1,3 @@ +date,posted,amount, +12/12/2011,12/13/2011,$10, +12/12/2011,,$20, diff --git a/test/regress/0DDDEBC0.test b/test/regress/0DDDEBC0.test new file mode 100644 index 00000000..cccb1b6b --- /dev/null +++ b/test/regress/0DDDEBC0.test @@ -0,0 +1,9 @@ +test -f /dev/null --input-date-format '%m/%d/%Y' convert test/regress/0DDDEBC0.dat +2011/12/12=2011/12/13 * + Expenses:Unknown $10 + Equity:Unknown + +2011/12/12 * + Expenses:Unknown $20 + Equity:Unknown +end test diff --git a/test/regress/25A099C9.test b/test/regress/25A099C9.test index d4eab662..fb362a4b 100644 --- a/test/regress/25A099C9.test +++ b/test/regress/25A099C9.test @@ -20,24 +20,24 @@ While parsing file "$sourcepath/src/amount.h", line 121: Error: Unexpected whitespace at beginning of line While parsing file "$sourcepath/src/amount.h", line 132: Error: Unexpected whitespace at beginning of line -While parsing file "$sourcepath/src/amount.h", line 702: +While parsing file "$sourcepath/src/amount.h", line 711: Error: Unexpected whitespace at beginning of line -While parsing file "$sourcepath/src/amount.h", line 732: +While parsing file "$sourcepath/src/amount.h", line 741: Error: Unexpected whitespace at beginning of line -While parsing file "$sourcepath/src/amount.h", line 740: +While parsing file "$sourcepath/src/amount.h", line 749: Error: Unexpected whitespace at beginning of line -While parsing file "$sourcepath/src/amount.h", line 743: +While parsing file "$sourcepath/src/amount.h", line 752: Error: Invalid date/time: line amount_t amoun -While parsing file "$sourcepath/src/amount.h", line 749: +While parsing file "$sourcepath/src/amount.h", line 758: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 755: +While parsing file "$sourcepath/src/amount.h", line 764: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 761: +While parsing file "$sourcepath/src/amount.h", line 770: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 767: +While parsing file "$sourcepath/src/amount.h", line 776: Error: Invalid date/time: line std::ostream& -While parsing file "$sourcepath/src/amount.h", line 774: +While parsing file "$sourcepath/src/amount.h", line 783: Error: Invalid date/time: line std::istream& -While parsing file "$sourcepath/src/amount.h", line 780: +While parsing file "$sourcepath/src/amount.h", line 789: Error: Unexpected whitespace at beginning of line end test diff --git a/test/regress/68917252.dat b/test/regress/68917252.dat new file mode 100644 index 00000000..8857f741 --- /dev/null +++ b/test/regress/68917252.dat @@ -0,0 +1,2 @@ +date,amount, +12/12/2011,10,test,extra,fields diff --git a/test/regress/68917252.test b/test/regress/68917252.test new file mode 100644 index 00000000..52fde1d9 --- /dev/null +++ b/test/regress/68917252.test @@ -0,0 +1,5 @@ +test -f /dev/null --input-date-format "%m/%d/%Y" convert test/regress/68917252.dat +2011/12/12 * + Expenses:Unknown 10 + Equity:Unknown +end test diff --git a/test/regress/A3FA7601.dat b/test/regress/A3FA7601.dat new file mode 100644 index 00000000..9a734e67 --- /dev/null +++ b/test/regress/A3FA7601.dat @@ -0,0 +1,3 @@ +date,posted,code,payee,amount,total,note, +12/12/2011,12/13/2011,100,Test,$10,$20,test, +12/12/2011,12/12/2011,,,$10,$20, diff --git a/test/regress/A3FA7601.test b/test/regress/A3FA7601.test new file mode 100644 index 00000000..5029f6d8 --- /dev/null +++ b/test/regress/A3FA7601.test @@ -0,0 +1,9 @@ +test -f /dev/null --input-date-format '%m/%d/%Y' convert test/regress/A3FA7601.dat +2011/12/12=2011/12/13 * (100) Test ;test + Expenses:Unknown $10 + Equity:Unknown $-10 = $20 + +2011/12/12=2011/12/12 * + Expenses:Unknown $10 + Equity:Unknown $-10 = $20 +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/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 |