Check iterator is done

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1300585 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2012-03-14 15:15:18 +00:00
parent 8033a710b0
commit ecf59bef6e
1 changed files with 3 additions and 1 deletions

View File

@ -353,10 +353,12 @@ public class CSVParserTest extends TestCase {
public void testUnicodeEscape() throws Exception {
String code = "abc,\\u0070\\u0075\\u0062\\u006C\\u0069\\u0063";
CSVParser parser = new CSVParser(code, CSVFormat.DEFAULT.withUnicodeEscapesInterpreted(true));
String[] data = parser.iterator().next();
final Iterator<String[]> iterator = parser.iterator();
String[] data = iterator.next();
assertEquals(2, data.length);
assertEquals("abc", data[0]);
assertEquals("public", data[1]);
assertFalse("Should not have any more records", iterator.hasNext());
}
public void testCarriageReturnLineFeedEndings() throws IOException {