1 (* $Id: test.ml,v 1.1 2003-12-17 16:05:08 rich Exp $ *)
6 let do_testcsv filename expected =
7 let csv = load filename in
8 if csv <> expected then (
9 printf "input file: %s\n" filename;
10 printf "Csv library produced:\n";
20 [ [ "This is a test\nwith commas,,,,,\n\nand carriage returns." ] ]
24 [ [ "Normal field"; "Quoted field"; "Quoted field with \"\" quotes" ] ]
32 [ ""; ""; ""; ""; "" ] ]
40 [ [ "This is a test\nwith commas,,,,,\n\nand carriage returns.";
41 "a second field"; "a third field" ];
42 [ "a fourth field on a new line" ] ]
46 [ [ "This is a test\nwith commas,,,,,\n\nand carriage returns\nand \000";
47 "a second field"; "a third field" ];
48 [ "a fourth field on a new line" ] ]
52 print_endline "All tests succeeded."