MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / test_csvreader

Function test_csvreader

tests/csvreader.cc:7–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5typedef std::vector<std::string> strings;
6
7static 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
23int main(int argc, const char* argv[])
24{

Callers 1

mainFunction · 0.85

Calls 1

readLineMethod · 0.45

Tested by

no test coverage detected