]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - basic/runtime/org.argeo.basic.nodeps/src/test/java/org/argeo/util/CsvParserTestCase.java
Have CsvParser dealing with line breaks
[lgpl/argeo-commons.git] / basic / runtime / org.argeo.basic.nodeps / src / test / java / org / argeo / util / CsvParserTestCase.java
index 0b17d67b562fcb59a57a535d3c0bc7bab016d2ef..5a8e4a8b8cd2bb8186e42a193f7e66761306455b 100644 (file)
@@ -9,9 +9,9 @@ import junit.framework.TestCase;
 public class CsvParserTestCase extends TestCase {
        public void testParse() throws Exception {
                String toParse = "Header1,\"Header2\",Header3,\"Header4\"\n"
-                               + "Col1,\"Col2\",Col3,\"\"\"Col4\"\"\"\n"
-                               + "Col1,\"Col2\",Col3,\"\"\"Col4\"\"\"\n"
-                               + "Col1,\"Col2\",Col3,\"\"\"Col4\"\"\"\n";
+                               + "Col1,\"Col\n2\",Col3,\"\"\"Col4\"\"\"\n"
+                               + "Col1,\"Col\n2\",Col3,\"\"\"Col4\"\"\"\n"
+                               + "Col1,\"Col\n2\",Col3,\"\"\"Col4\"\"\"\n";
 
                InputStream in = new ByteArrayInputStream(toParse.getBytes());
 
@@ -21,7 +21,7 @@ public class CsvParserTestCase extends TestCase {
                                assertEquals(header.size(), tokens.size());
                                assertEquals(4, tokens.size());
                                assertEquals("Col1", tokens.get(0));
-                               assertEquals("Col2", tokens.get(1));
+                               assertEquals("Col\n2", tokens.get(1));
                                assertEquals("Col3", tokens.get(2));
                                assertEquals("\"Col4\"", tokens.get(3));
                        }