views:

13

answers:

1

i am facing some problem for writing test suite (test cases)for basic CSV specification . i have no idea how to write that? can anyone help?

A: 

First read http://en.wikipedia.org/wiki/Comma-separated_values then think of as many evil ways as possible to corrupt the input: too many fields per line, missing field/line delimiters, unbalanced field/line delimiters, inconsistent field/line delimiters and escape characters, etc, etc.

joe snyder
although bear in mind that the RFC differs slightly from the format used by Excel (treatment of leading / trailing spaces I think). RFC or not Excel's way is probably the defacto standard. You should also use Excel and OpenOffice to generate spreadsheets with as many of the corner cases you've come up with too and check your implementation can parse those, and that CSVs you generate will open in both Excel and OpenOffice.
Rup