Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions csv.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,7 @@ Be careful to not skip a separator, as it could be e.g. a tab!"
(setf had-quotes nil)
(when *skip-whitespace*
(accept-spaces stream))
(cond
((and (null fields)
(or (accept-eol stream) (accept-eof stream)))
(done))
(t
(do-field-start))))
(do-field-start))
(do-field-start ()
(cond
((accept-separator stream)
Expand Down
19 changes: 18 additions & 1 deletion test.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,25 @@
")
(test-read-write
" "
'(())
'((""))
+lf+)
(test-both
""
'()))

(deftest test-empty-field ()
(test-read
"a

c"
'(("a")
("")
("c")))
(test-read
"a
"
'(("a")))
(test-read
"a
"
'(("a") (""))))