diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-20 21:33:23 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-20 21:33:23 -0500 |
commit | 117dddabd4f883de4f464821f9567d889a6fa449 (patch) | |
tree | 602c8c5e72b81ffc9bcf01bbaed5e2875d0e60a0 /test | |
parent | cc9110a43a1e2d006de8d24a84bbfb2c6918cf33 (diff) | |
parent | 4e6ec09e4d2a69dcb06627e44512980b09561448 (diff) | |
download | fork-ledger-117dddabd4f883de4f464821f9567d889a6fa449.tar.gz fork-ledger-117dddabd4f883de4f464821f9567d889a6fa449.tar.bz2 fork-ledger-117dddabd4f883de4f464821f9567d889a6fa449.zip |
Merge branch 'next'
Diffstat (limited to 'test')
-rw-r--r-- | test/baseline/test-sample.dat | 91 | ||||
-rwxr-xr-x | test/convert.py | 2 | ||||
-rw-r--r-- | test/input/sample.dat | 34 | ||||
-rw-r--r-- | test/regress/25A099C9.test | 12 |
4 files changed, 121 insertions, 18 deletions
diff --git a/test/baseline/test-sample.dat b/test/baseline/test-sample.dat new file mode 100644 index 00000000..4bfbe1e2 --- /dev/null +++ b/test/baseline/test-sample.dat @@ -0,0 +1,91 @@ +reg +<<< +; -*- ledger -*- + +N $ + += /^Expenses:Books/ + (Liabilities:Taxes) -0.10 + +~ Monthly + Assets:Bank:Checking $500.00 + Income:Salary + +~ Yearly + Expenses:Donations $100.00 + Assets:Bank:Checking + +2004/05/01 * Checking balance + Assets:Bank:Checking $1,000.00 + Equity:Opening Balances + +2004/05/03=2004/05/01 * Investment balance + Assets:Brokerage 50 AAPL @ $30.00 + Equity:Opening Balances + +2004/05/14 * Páy dày + Assets:Bank:Checking 500.00€ + Income:Salary + +2004/05/14 * Another dày in which there is Páying + Asséts:Bánk:Chécking:Asséts:Bánk:Chécking $500.00 + Income:Salary + +2004/05/14 * Another dày in which there is Páying + Русский язык:Активы:Русский язык:Русский язык $1000.00 + Income:Salary + +tag foo + +2004/05/27 Book Store + Expenses:Books $20.00 + Expenses:Cards $40.00 + Expenses:Docs $30.00 + Liabilities:MasterCard + +end tag + +2004/05/27 (100) Credit card company + ; This is an xact note! + ; Sample: Value + Liabilities:MasterCard $20.00 + ; This is a posting note! + ; Sample: Another Value + ; :MyTag: + Assets:Bank:Checking + ; :AnotherTag: +>>>1 +04-May-01 Checking balance Assets:Bank:Checking $1,000.00 $1,000.00 + Eq:Opening Balances $-1,000.00 0 +04-May-03 Investment balance Assets:Brokerage 50 AAPL 50 AAPL + Eq:Opening Balances $-1,500.00 $-1,500.00 + 50 AAPL +04-May-14 Páy dày Assets:Bank:Checking 500.00€ $-1,500.00 + 50 AAPL + 500.00€ + Income:Salary -500.00€ $-1,500.00 + 50 AAPL +04-May-14 Another dày in whic.. ..Bá:Ch:As:Bá:Chécking $500.00 $-1,000.00 + 50 AAPL + Income:Salary $-500.00 $-1,500.00 + 50 AAPL +04-May-14 Another dày in whic.. Ру:Ак:Ру:Русский язык $1,000.00 $-500.00 + 50 AAPL + Income:Salary $-1,000.00 $-1,500.00 + 50 AAPL +04-May-27 Book Store Expenses:Books $20.00 $-1,480.00 + 50 AAPL + Expenses:Cards $40.00 $-1,440.00 + 50 AAPL + Expenses:Docs $30.00 $-1,410.00 + 50 AAPL + Liabilities:MasterCard $-90.00 $-1,500.00 + 50 AAPL + (Liabilities:Taxes) $-2.00 $-1,502.00 + 50 AAPL +04-May-27 Credit card company Liabilities:MasterCard $20.00 $-1,482.00 + 50 AAPL + Assets:Bank:Checking $-20.00 $-1,502.00 + 50 AAPL +>>>2 +=== 0 diff --git a/test/convert.py b/test/convert.py index 0c64fde4..05a62b7e 100755 --- a/test/convert.py +++ b/test/convert.py @@ -158,6 +158,8 @@ for line in fd.readlines(): line = re.sub('false', 'False', line) line = re.sub('CURRENT_TIME\(\)', 'datetime.now()', line) line = re.sub('CURRENT_DATE\(\)', 'date.today()', line) + line = re.sub('commodity\(\)', 'commodity', line) + line = re.sub('precision\(\)', 'precision', line) line = re.sub('([0-9]+)[FL]', '\\1', line) line = re.sub('([0-9]+)UL', '\\1L', line) line = re.sub(';', '', line) diff --git a/test/input/sample.dat b/test/input/sample.dat index 002d20ee..12ac4cb4 100644 --- a/test/input/sample.dat +++ b/test/input/sample.dat @@ -1,42 +1,52 @@ +; -*- ledger -*- + N $ -= account =~ /^Expenses:Books/ - (Liabilities:Taxes) -0.10 += /^Expenses:Books/ + (Liabilities:Taxes) -0.10 ~ Monthly - Assets:Bank:Checking $500.00 + Assets:Bank:Checking $500.00 Income:Salary +~ Yearly + Expenses:Donations $100.00 + Assets:Bank:Checking + 2004/05/01 * Checking balance - Assets:Bank:Checking $1,000.00 + Assets:Bank:Checking $1,000.00 Equity:Opening Balances 2004/05/03=2004/05/01 * Investment balance - Assets:Brokerage 50 AAPL @ $30.00 + Assets:Brokerage 50 AAPL @ $30.00 Equity:Opening Balances 2004/05/14 * Páy dày - Assets:Bank:Checking 500.00€ + Assets:Bank:Checking 500.00€ Income:Salary 2004/05/14 * Another dày in which there is Páying - Asséts:Bánk:Chécking:Asséts:Bánk:Chécking $500.00 + Asséts:Bánk:Chécking:Asséts:Bánk:Chécking $500.00 Income:Salary 2004/05/14 * Another dày in which there is Páying - Русский язык:Русский язык:Русский язык:Русский язык $1000.00 + Русский язык:Активы:Русский язык:Русский язык $1000.00 Income:Salary +tag foo + 2004/05/27 Book Store - Expenses:Books $20.00 - Expenses:Cards $40.00 - Expenses:Docs $30.00 + Expenses:Books $20.00 + Expenses:Cards $40.00 + Expenses:Docs $30.00 Liabilities:MasterCard +end tag + 2004/05/27 (100) Credit card company ; This is an xact note! ; Sample: Value - Liabilities:MasterCard $20.00 + Liabilities:MasterCard $20.00 ; This is a posting note! ; Sample: Another Value ; :MyTag: diff --git a/test/regress/25A099C9.test b/test/regress/25A099C9.test index 604939d8..dec51008 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 721: +While parsing file "$sourcepath/src/amount.h", line 717: Error: Invalid date/time: line amount_t amoun -While parsing file "$sourcepath/src/amount.h", line 727: +While parsing file "$sourcepath/src/amount.h", line 723: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 733: +While parsing file "$sourcepath/src/amount.h", line 729: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 739: +While parsing file "$sourcepath/src/amount.h", line 735: Error: Invalid date/time: line string amount_ -While parsing file "$sourcepath/src/amount.h", line 745: +While parsing file "$sourcepath/src/amount.h", line 741: Error: Invalid date/time: line std::ostream& -While parsing file "$sourcepath/src/amount.h", line 752: +While parsing file "$sourcepath/src/amount.h", line 748: Error: Invalid date/time: line std::istream& === 7 |