parsing: fix test breakage due to new csv rules format (fixes #102)

This commit is contained in:
Simon Michael 2013-04-12 14:59:28 -07:00
parent a694cfcfcd
commit 78837c66a6
2 changed files with 4 additions and 4 deletions

View File

@ -708,10 +708,10 @@ test_parser = [
-- ([("A",Nothing)], "a")
,"convert rules parsing: trailing comments" ~: do
assertParse (parseWithCtx rules rulesp "A\na\n# \n#\n")
assertParse (parseWithCtx rules rulesp "skip\n# \n#\n")
,"convert rules parsing: trailing blank lines" ~: do
assertParse (parseWithCtx rules rulesp "A\na\n\n \n")
assertParse (parseWithCtx rules rulesp "skip\n\n \n")
-- not supported
-- ,"convert rules parsing: no final newline" ~: do

View File

@ -1,5 +1,5 @@
# 1. read CSV to hledger journal format
rm -rf t.rules$$; printf 'date-field 0\ndate-format %%d/%%Y/%%m\ndescription-field 1\namount-field 2\ncurrency $\nbase-account assets:myacct\n' >t.rules$$; echo '10/2009/09,Flubber Co,50' | hledgerdev -f- print --rules-file t.rules$$; rm -rf t.rules$$
rm -rf t.rules$$; printf 'fields date, description, amount\ndate-format %%d/%%Y/%%m\ncurrency $\naccount1 assets:myacct\n' >t.rules$$; echo '10/2009/09,Flubber Co,50' | hledgerdev -f- print --rules-file t.rules$$; rm -rf t.rules$$
>>>
2009/09/10 Flubber Co
income:unknown $-50
@ -9,7 +9,7 @@
>>>=0
# 2. reading CSV with in-field and out-field
printf 'base-account Assets:MyAccount\ndate-field 0\ndate-format %%d/%%Y/%%m\ndescription-field 1\nin-field 2\nout-field 3\ncurrency $\n' >$$.rules ; hledgerdev -f- print --rules-file $$.rules; rm -rf $$.rules
printf 'account1 Assets:MyAccount\ndate %%1\ndate-format %%d/%%Y/%%m\ndescription %%2\namount-in %%3\namount-out %%4\ncurrency $\n' >$$.rules ; hledgerdev -f- print --rules-file $$.rules; rm -rf $$.rules
<<<
10/2009/09,Flubber Co,50,
11/2009/09,Flubber Co,,50