Пример #1
1
 // won't round-trip
 public void testEmptyQuote() {
   assertEquals(CSV.split("a,\"\",b"), List.of("a", "", "b"));
 }
Пример #2
1
 // won't round-trip
 public void testExtraQuote() {
   assertEquals(CSV.split("a,\"b\",c"), List.of("a", "b", "c"));
 }
Пример #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);
 }
Пример #4
0
 @Test(expectedExceptions = CSVParseException.class)
 public void errorUnclosedQuote() {
   CSV.split("a,\"b");
 }
Пример #5
0
 @Test(expectedExceptions = CSVParseException.class)
 public void errorCharacterAfterQuote() {
   CSV.split("a,\"b\"c,d");
 }
Пример #6
0
 @Test(expectedExceptions = CSVParseException.class)
 public void errorUnexpectedQuote() {
   CSV.split("ab\"cd");
 }