You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2012/03/14 16:15:18 UTC

svn commit: r1300585 - /commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java

Author: sebb
Date: Wed Mar 14 15:15:18 2012
New Revision: 1300585

URL: http://svn.apache.org/viewvc?rev=1300585&view=rev
Log:
Check iterator is done

Modified:
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java

Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java?rev=1300585&r1=1300584&r2=1300585&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java (original)
+++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java Wed Mar 14 15:15:18 2012
@@ -353,10 +353,12 @@ public class CSVParserTest extends TestC
     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 {