From e2c9147ee57dcedff93d69eb8341616a15ff8bd9 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Fri, 7 Sep 2018 13:43:05 -0700 Subject: [PATCH] csv: some follow-on issues related to #829 --- tests/csv/csv-read.test | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/tests/csv/csv-read.test b/tests/csv/csv-read.test index 680f522de..87a2e1a40 100644 --- a/tests/csv/csv-read.test +++ b/tests/csv/csv-read.test @@ -109,4 +109,42 @@ expenses:unknown $50 >>>2 ->>>=0 \ No newline at end of file +>>>=0 + +# 9. TODO: without --separator gives obscure error +# | +# 1 | 10/2009/09;Flubber Co🎅;50; +# | ^^^^^^^^^^ +# well-formed but invalid date: 10/2009/9 +# printf 'account1 Assets:MyAccount\ndate %%1\ndate-format %%d/%%Y/%%m\ndescription %%2\namount-in %%3\namount-out %%4\ncurrency $\n' >rules.$$ ; hledger -f csv:- --rules-file rules.$$ print && rm -rf rules.$$ +# <<< +# 10/2009/09;Flubber Co🎅;50; +# 11/2009/09;Flubber Co🎅;;50 +# >>> +# 2009/09/10 Flubber Co🎅 +# Assets:MyAccount $50 +# income:unknown $-50 +# +# 2009/09/11 Flubber Co🎅 +# Assets:MyAccount $-50 +# expenses:unknown $50 +# +# >>>2 +# >>>=0 + +# 10. reading TSV (tab-separated) TODO user error (CSV record ["10/2009/09\tFlubber Co\127877\t50\t"] has less than two fields) +# printf 'account1 Assets:MyAccount\ndate %%1\ndate-format %%d/%%Y/%%m\ndescription %%2\namount-in %%3\namount-out %%4\ncurrency $\n' >rules.$$ ; hledger --separator "\t" -f csv:- --rules-file rules.$$ print && rm -rf rules.$$ +# <<< +# 10/2009/09 Flubber Co🎅 50 +# 11/2009/09 Flubber Co🎅 50 +# >>> +# 2009/09/10 Flubber Co🎅 +# Assets:MyAccount $50 +# income:unknown $-50 +# +# 2009/09/11 Flubber Co🎅 +# Assets:MyAccount $-50 +# expenses:unknown $50 +# +# >>>2 +# >>>=0