#
# csv8.txt - string i/o tests
#

csvopen     1 '' s
csvstrin    1 fld1,"x,y",,23       # load in a string
csvgetn     1                      # should return 4
csvgetfield 1 0                    # should get 'fld1'
csvgetfield 1 1                    # should get 'x,y'
csvgetfield 1 2                    # should get ''
csvgetfield 1 3                    # should get '23'

csvstrprep  1                      # Prepare an empty string
csvputstr   1  rubbish             # OK
csvputint   1  13                  # OK
csvputreal  1  1.3                 # OK
csvstrout   1                      # should get '"rubbish",13,1.3'

csvstrprep  1                      # Prepare another string
csvputstr   1 comma"normal         # output "comma""normal"
csvputint   1 42                   # output ,42
csvputreal  1 314.15926            # output ,314.15926
csvstrout   1                      # should get '"comma""normal",42,314.15926000000002'
csvclose    1                      # OK

csvopen     2 '' s
csvgetn     2                      # should get zero
csvgetfield 2 0                    # returns nil
csvclose    2                      # OK

csvopen     3 '' s
csvputstr   3 field1               # OK
csvstrout   3                      # should get '"field1"'
csvclose    3                      # OK

csvopen     4 '' s
csvstrprep  4                      # prepare a string
csvsetquote 4 MINIMAL              # OK
csvputstr   4 data                 # write one field
csvstrout   4                      # should get 'data'
csvputstr   4 data2                # write one field
csvstrout   4                      # should get 'data,data2'
csvclose    4

#
# No errors expected
#
