tuples.add(tuple);
assertEquals(7, tuples.size());
// test normal case
Tuple tuple0 = tuples.get(0);
assertEquals("a", tuple0.get(0));
assertEquals("b", tuple0.get(1));
assertEquals("c", tuple0.get(2));
// test quoted commas
Tuple tuple1 = tuples.get(1);
assertEquals("a", tuple1.get(0));
assertEquals("b,b,b", tuple1.get(1));
assertEquals("c", tuple1.get(2));
// test empty elements
Tuple tuple2 = tuples.get(2);
assertEquals(3, tuple2.getNrCols());
// test multiline quoted
Tuple tuple3 = tuples.get(3);
assertEquals(3, tuple3.getNrCols());
// test quoted quote chars
Tuple tuple4 = tuples.get(4);
assertEquals("Glen \"The Man\" Smith", tuple4.get(0));
Tuple tuple5 = tuples.get(5);
assertEquals("\"\"", tuple5.get(0)); // check the tricky
// situation
assertEquals("test", tuple5.get(1)); // make sure we didn't
// ruin the next field..
Tuple tuple6 = tuples.get(6);
assertEquals(4, tuple6.getNrCols());
}
finally
{
csvReader.close();
}