mirror of
https://github.com/simonmichael/hledger.git
synced 2024-12-28 12:54:07 +03:00
parsing: fix test breakage due to new csv rules format (fixes #102)
This commit is contained in:
parent
a694cfcfcd
commit
78837c66a6
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user