Test multiple adjacent comments

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306650 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-03-29 00:03:19 +00:00
parent 70f00f973a
commit 02a36dd41d

View File

@ -333,11 +333,13 @@ public class CSVParserTest {
+ "a,b\n" // 1)
+ "\"\n\",\" \"\n" // 2)
+ "#,\"\"\n" // 3)
+ "# Final comment\n"// 4)
;
String[][] res = {
{"a", "b"},
{"\n", " "},
{"#", ""},
{"# Final comment"}
};
CSVFormat format = CSVFormat.DEFAULT;
@ -347,7 +349,7 @@ public class CSVParserTest {
List<CSVRecord> records = parser.getRecords();
assertTrue(records.size() > 0);
assertTrue(CSVPrinterTest.equals(res, records));
assertTrue("Failed to parse without comments", CSVPrinterTest.equals(res, records));
String[][] res_comments = {
{"a", "b"},
@ -358,7 +360,7 @@ public class CSVParserTest {
parser = new CSVParser(code, format);
records = parser.getRecords();
assertTrue(CSVPrinterTest.equals(res_comments, records));
assertTrue("Failed to parse with comments",CSVPrinterTest.equals(res_comments, records));
}
@Test