#
# csv4.txt - input tests
#

csvgetline  1               # should fail
csvgetfield 1 0             # should fail
csvgetn     1               # should fail

csvopen 1 data/csv4.input r # should open OK

csvgetn     1               # expecting 0

csvgetline  1               # "string",42,, blanks around and in , END
csvgetn     1               # expecting 5
csvgetfield 1 0             # 'string'
csvgetfield 1 1             # '42'
csvgetfield 1 2             # ''
csvgetfield 1 3             # ' blanks around and in '
csvgetfield 1 4             # ' END'

csvgetline  1               # blank line
csvgetn     1               # expecting 0

csvgetline  1               # double " quote,"yes, I can","enclosed "" quote",X
csvgetn     1               # expecting 4
csvgetfield 1 0             # 'double " quote'
csvgetfield 1 1             # 'yes, I can'
csvgetfield 1 2             # 'enclosed " quote'
csvgetfield 1 3             # 'X'

csvsetsep   1 |
csvsetquote 1 NEVER
csvgetline  1               # Field 1|is|23|Field 2|3.1415926|-3||FINAL
csvgetn     1               # expecting 8
csvgetfield 1 0             # 'Field 1'
csvgetfield 1 1             # 'is'
csvgetfield 1 2             # '23'
csvgetfield 1 3             # 'Field 2'
csvgetfield 1 4             # '3.1415926'
csvgetfield 1 5             # '-3'
csvgetfield 1 6             # ''
csvgetfield 1 7             # 'FINAL'

csvgetline  1               # should return (nil) for end of file

csvclose 1                  # should close OK
 
#
# Should throw 3 errors
#
