csv: empty strings and files are valid csv:s

db4
Björn Lindqvist 2014-02-19 10:07:28 +01:00 committed by John Benediktsson
parent ad63d24263
commit dc3c947a5e
2 changed files with 3 additions and 1 deletions

View File

@ -100,3 +100,5 @@ IN: csv.tests
! FIXME: { { { "as,df" "asdf" } } } [ "\"as,\"df ,asdf" string>csv ] unit-test
! FIXME: { { { "asd\"f\"" "asdf" } } } [ "\"asd\"\"\"f\",asdf" string>csv ] unit-test
{ { { "as,d\"f" "asdf" } } } [ "\"as,\"d\"\"\"\"f,asdf" string>csv ] unit-test
[ { } ] [ "" string>csv ] unit-test

View File

@ -68,7 +68,7 @@ PRIVATE>
: stream-read-csv ( stream -- rows )
[ (stream-read-csv) ] { } make
dup last { "" } = [ but-last ] when ; inline
dup ?last { "" } = [ but-last ] when ; inline
: read-csv ( -- rows )
input-stream get stream-read-csv ; inline