Added more option baseline tests

This commit is contained in:
John Wiegley 2009-02-20 18:36:47 -04:00
parent 9d9f526816
commit 8483ea16e2
6 changed files with 68 additions and 3 deletions

View file

@ -0,0 +1,15 @@
reg --collapse-if-zero
<<<
2007/02/02 RD VMMXX
Assets:Investments:Vanguard:VMMXX $0.35
Income:Dividends:Vanguard:VMMXX $-0.35
2007/02/02 RD VMMXX
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
07-Feb-02 RD VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
In:Di:Vanguard:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0

View file

@ -0,0 +1,11 @@
reg --columns=100
<<<
2007/02/02 RD VMMXX
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
07-Feb-02 RD VMMXX As:Investments:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
In:Dividends:Vanguard:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0

View file

@ -0,0 +1,11 @@
reg --commodity-as-account
<<<
2007/02/02 RD VMMXX
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
07-Feb-02 RD VMMXX VMMXX 0.350 VMMXX 0.350 VMMXX
07-Feb-02 RD VMMXX $ $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0

View file

@ -0,0 +1,11 @@
reg --commodity-as-payee
<<<
2007/02/02 RD VMMXX
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
07-Feb-02 VMMXX As:In:Vanguard:VMMXX 0.350 VMMXX 0.350 VMMXX
07-Feb-02 $ In:Di:Vanguard:VMMXX $-0.35 $-0.35
0.350 VMMXX
>>>2
=== 0

View file

@ -0,0 +1,10 @@
csv --csv-format='"%(date)"\n'
<<<
2007/02/02 RD VMMXX
Assets:Investments:Vanguard:VMMXX 0.350 VMMXX @ $1.00
Income:Dividends:Vanguard:VMMXX $-0.35
>>>1
"07-Feb-02"
"07-Feb-02"
>>>2
=== 0

View file

@ -40,6 +40,9 @@ def test_regression(test_file):
if command.startswith("-f - "):
use_stdin = True
if re.search('--columns', command):
command = ("%s" % ledger) + " --args-only " + command
else:
command = ("%s" % ledger) + " --args-only --columns=80 " + command
else:
tempdata = tempfile.mkstemp()
@ -47,6 +50,10 @@ def test_regression(test_file):
os.write(tempdata[0], string.join(data, ''))
os.close(tempdata[0])
if re.search('--columns', command):
command = (("%s -f \"%s\" " % (ledger, tempdata[1])) +
" --args-only " + command)
else:
command = (("%s -f \"%s\" " % (ledger, tempdata[1])) +
" --args-only --columns=80 " + command)