예제 #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");
 }