| 5 | typedef std::vector<std::string> strings; |
| 6 | |
| 7 | static void test_csvreader() |
| 8 | { |
| 9 | std::string data( |
| 10 | "header1,header2,header3\n" |
| 11 | "1,2,3\n" |
| 12 | "foo bar\n" |
| 13 | "1,\"2,3\",4\n"); |
| 14 | std::istringstream istream(data); |
| 15 | CsvReader reader(istream); |
| 16 | |
| 17 | assert((reader.readLine() == strings{"header1", "header2", "header3"})); |
| 18 | assert((reader.readLine() == strings{"1", "2", "3"})); |
| 19 | assert((reader.readLine() == strings{"foo bar"})); |
| 20 | assert((reader.readLine() == strings{"1", "2,3", "4"})); |
| 21 | } |
| 22 | |
| 23 | int main(int argc, const char* argv[]) |
| 24 | { |