Beispiel #1
1
 // won't round-trip
 public void testEmptyQuote() {
   assertEquals(CSV.split("a,\"\",b"), List.of("a", "", "b"));
 }
Beispiel #2
1
 // won't round-trip
 public void testExtraQuote() {
   assertEquals(CSV.split("a,\"b\",c"), List.of("a", "b", "c"));
 }
Beispiel #3
0
 @Test(dataProvider = "csvdata")
 public void roundTrip(String input, List<String> parsed) {
   List<String> actual = CSV.split(input);
   assertEquals(actual, parsed);
   CSV.write(out, actual.toArray());
   checkString(input);
 }
Beispiel #4
0
 @Test(expectedExceptions = CSVParseException.class)
 public void errorUnclosedQuote() {
   CSV.split("a,\"b");
 }
Beispiel #5
0
 @Test(expectedExceptions = CSVParseException.class)
 public void errorCharacterAfterQuote() {
   CSV.split("a,\"b\"c,d");
 }
Beispiel #6
0
 @Test(expectedExceptions = CSVParseException.class)
 public void errorUnexpectedQuote() {
   CSV.split("ab\"cd");
 }