diff options
author | John Wiegley <johnw@newartisans.com> | 2010-06-02 01:55:55 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-06-02 01:55:55 -0400 |
commit | cda19829bd1100d6563b48ddb121f2afc1c55d95 (patch) | |
tree | 5b6ab0d1eb7ec1b0b3eccf817678d0aa9a3feb47 /test | |
parent | 017492ef5e80003073c5d053252d4a68a44260ae (diff) | |
parent | fb7cafa8965c89bbd66b09f827bd5989a87c983b (diff) | |
download | fork-ledger-cda19829bd1100d6563b48ddb121f2afc1c55d95.tar.gz fork-ledger-cda19829bd1100d6563b48ddb121f2afc1c55d95.tar.bz2 fork-ledger-cda19829bd1100d6563b48ddb121f2afc1c55d95.zip |
Merge branch 'next'
Diffstat (limited to 'test')
-rwxr-xr-x | test/ConfirmTests.py | 2 | ||||
-rw-r--r-- | test/baseline/cmd-print.test | 11 | ||||
-rw-r--r-- | test/baseline/opt-code-as-payee.test | 4 | ||||
-rw-r--r-- | test/baseline/opt-gain.test | 3 | ||||
-rw-r--r-- | test/baseline/opt-price.test | 6 | ||||
-rw-r--r-- | test/regress/25A099C9.test | 12 | ||||
-rw-r--r-- | test/regress/D943AE0F.test | 4 | ||||
-rw-r--r-- | test/unit/t_amount.cc | 6 | ||||
-rw-r--r-- | test/unit/t_expr.cc | 6 |
9 files changed, 33 insertions, 21 deletions
diff --git a/test/ConfirmTests.py b/test/ConfirmTests.py index 901ae7cd..6fc04336 100755 --- a/test/ConfirmTests.py +++ b/test/ConfirmTests.py @@ -84,7 +84,7 @@ def confirm_report(command): return not failure for cmd in commands: - if confirm_report('$ledger $cmd ' + re.sub('\$tests', tests, cmd)): + if confirm_report('$ledger --rounding $cmd ' + re.sub('\$tests', tests, cmd)): harness.success() else: harness.failure() diff --git a/test/baseline/cmd-print.test b/test/baseline/cmd-print.test new file mode 100644 index 00000000..6099b39f --- /dev/null +++ b/test/baseline/cmd-print.test @@ -0,0 +1,11 @@ +print --decimal-comma +<<< +2008/12/31 Market + Expenses:Food ($10,00 + $2,50) + Assets:Cash +>>>1 +2008/12/31 Market + Expenses:Food ($10,00 + $2,50) + Assets:Cash +>>>2 +=== 0 diff --git a/test/baseline/opt-code-as-payee.test b/test/baseline/opt-code-as-payee.test index c2988626..99aa182e 100644 --- a/test/baseline/opt-code-as-payee.test +++ b/test/baseline/opt-code-as-payee.test @@ -28,7 +28,7 @@ reg --payee=code 08-Feb-01 102 Assets:Cash $-20.00 0 08-Feb-28 103 Expenses:Books $20.00 $20.00 08-Feb-28 103 Assets:Cash $-20.00 0 -08-Mar-01 Expenses:Books $30.00 $30.00 -08-Mar-01 Assets:Cash $-30.00 0 +08-Mar-01 March Expenses:Books $30.00 $30.00 +08-Mar-01 March Assets:Cash $-30.00 0 >>>2 === 0 diff --git a/test/baseline/opt-gain.test b/test/baseline/opt-gain.test index 8aeb8bab..63055d5f 100644 --- a/test/baseline/opt-gain.test +++ b/test/baseline/opt-gain.test @@ -50,7 +50,8 @@ P 2010/03/01 00:00:00 S 8 P P 2010/04/01 00:00:00 S 16 P >>>1 09-Jan-01 Sample 1a As:Brokerage:Stocks 0 0 -09-Feb-01 Commodities revalued <Revalued> 300 P 300 P +09-Jan-15 Commodities revalued <Revalued> 100 P 100 P +09-Feb-01 Commodities revalued <Revalued> 200 P 300 P 09-Feb-01 Sample 2a As:Brokerage:Stocks 300 P 600 P 09-Mar-01 Commodities revalued <Revalued> 800 P 1400 P 09-Mar-01 Sample 3a As:Brokerage:Stocks 700 P 2100 P diff --git a/test/baseline/opt-price.test b/test/baseline/opt-price.test index 06cc7751..133b2155 100644 --- a/test/baseline/opt-price.test +++ b/test/baseline/opt-price.test @@ -28,7 +28,8 @@ reg --end 2009/06/26 -V equities 08-Jan-01 Purchase Apple shares Equities $2000 $2000 08-Jun-30 Commodities revalued <Revalued> $500 $2500 08-Jun-30 Sell some Apple sha.. Equities $-1250 $1250 -09-Jun-26 Commodities revalued <Revalued> $750 $2000 +09-Jan-31 Commodities revalued <Revalued> $250 $1500 +09-Jun-26 Commodities revalued <Revalued> $500 $2000 >>>2 === 0 reg --end 2009/06/26 -G equities @@ -36,7 +37,8 @@ reg --end 2009/06/26 -G equities 08-Jan-01 Purchase Apple shares Equities 0 0 08-Jun-30 Commodities revalued <Revalued> $500 $500 08-Jun-30 Sell some Apple sha.. Equities 0 $500 -09-Jun-26 Commodities revalued <Revalued> $750 $1250 +09-Jan-31 Commodities revalued <Revalued> $250 $750 +09-Jun-26 Commodities revalued <Revalued> $500 $1250 >>>2 === 0 reg -I equities diff --git a/test/regress/25A099C9.test b/test/regress/25A099C9.test index 4067d005..a74b0601 100644 --- a/test/regress/25A099C9.test +++ b/test/regress/25A099C9.test @@ -4,16 +4,16 @@ >>>2 While parsing file "$sourcepath/src/amount.h", line 67: Error: No quantity specified for amount -While parsing file "$sourcepath/src/amount.h", line 720: +While parsing file "$sourcepath/src/amount.h", line 718: Error: Invalid date/time: line amount_t amoun -While parsing file "$sourcepath/src/amount.h", line 726: +While parsing file "$sourcepath/src/amount.h", line 724: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 732: +While parsing file "$sourcepath/src/amount.h", line 730: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 738: +While parsing file "$sourcepath/src/amount.h", line 736: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 744: +While parsing file "$sourcepath/src/amount.h", line 742: Error: Invalid date/time: line std::ostream& -While parsing file "$sourcepath/src/amount.h", line 751: +While parsing file "$sourcepath/src/amount.h", line 749: Error: Invalid date/time: line std::istream& === 7 diff --git a/test/regress/D943AE0F.test b/test/regress/D943AE0F.test index 94a26df5..7a2e14d8 100644 --- a/test/regress/D943AE0F.test +++ b/test/regress/D943AE0F.test @@ -1,4 +1,4 @@ -reg -V --end=2009/06/16 +reg -V <<< D 1000.00 EUR @@ -10,6 +10,6 @@ P 2008/04/20 00:00:00 CAD 1.20 EUR >>>1 08-Apr-15 Paid expenses back .. Ex:Cie-Reimbursements 2200.00 EUR 2200.00 EUR Assets:Checking -2200.00 EUR 0 -09-Jun-16 Commodities revalued <Revalued> 200.00 EUR 200.00 EUR +08-Apr-20 Commodities revalued <Revalued> 200.00 EUR 200.00 EUR >>>2 === 0 diff --git a/test/unit/t_amount.cc b/test/unit/t_amount.cc index 2c91ee98..63d82675 100644 --- a/test/unit/t_amount.cc +++ b/test/unit/t_amount.cc @@ -64,9 +64,9 @@ void AmountTestCase::testParser() x16.parse("$2000,00"); assertEqual(string("$2.000,00"), x16.to_string()); - // Since European-ness is an additive quality, we must switch back - // to American-ness manually - x15.commodity().drop_flags(COMMODITY_STYLE_EUROPEAN); + // Since use of a decimal-comma is an additive quality, we must switch back + // to decimal-period manually. + x15.commodity().drop_flags(COMMODITY_STYLE_DECIMAL_COMMA); amount_t x17("$1,000,000.00"); // parsing this switches back to American diff --git a/test/unit/t_expr.cc b/test/unit/t_expr.cc index b5865948..0d88be9e 100644 --- a/test/unit/t_expr.cc +++ b/test/unit/t_expr.cc @@ -158,8 +158,6 @@ void ValueExprTestCase::testPredicateTokenizer7() assertEqual(query_t::lexer_t::token_t::TOK_EQ, tokens.next_token().kind); assertEqual(query_t::lexer_t::token_t::TERM, tokens.next_token().kind); - assertEqual(query_t::lexer_t::token_t::TOK_AND, tokens.next_token().kind); - assertEqual(query_t::lexer_t::token_t::TERM, tokens.next_token().kind); assertEqual(query_t::lexer_t::token_t::END_REACHED, tokens.next_token().kind); #endif } @@ -167,7 +165,7 @@ void ValueExprTestCase::testPredicateTokenizer7() void ValueExprTestCase::testPredicateTokenizer8() { value_t args; - args.push_back(string_value("expr foo and bar")); + args.push_back(string_value("expr 'foo and bar'")); #ifndef NOT_FOR_PYTHON query_t::lexer_t tokens(args.begin(), args.end()); @@ -182,7 +180,7 @@ void ValueExprTestCase::testPredicateTokenizer9() { value_t args; args.push_back(string_value("expr")); - args.push_back(string_value("foo and bar")); + args.push_back(string_value("'foo and bar'")); #ifndef NOT_FOR_PYTHON query_t::lexer_t tokens(args.begin(), args.end()); |