You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/06/14 12:01:15 UTC

[GitHub] [commons-csv] aherbert commented on a change in pull request #44: Post release fixes

aherbert commented on a change in pull request #44: Post release fixes
URL: https://github.com/apache/commons-csv/pull/44#discussion_r293777719
 
 

 ##########
 File path: src/test/java/org/apache/commons/csv/CSVPrinterTest.java
 ##########
 @@ -1471,4 +1471,31 @@ public void testTrimOnTwoColumns() throws IOException {
         return CSVParser.parse(expected, format).getRecords().get(0).values();
     }
 
+    @Test
+    public void testPrintReaderWithoutQuoteToWriter() throws IOException {
+        // Test to target the use of IOUtils::copyLarge.
+        // Requires the format to have no quote or escape character,
+        // value to be a java.io.Reader and the output to be a java.io.Writer.
+        final StringWriter sw = new StringWriter();
+        final String content = "testValue";
+        try (final CSVPrinter printer = new CSVPrinter(sw, CSVFormat.DEFAULT.withQuote(null))) {
+            final StringReader value = new StringReader(content);
+            printer.print(value);
+        }
+        assertEquals(content, sw.toString());
+    }
+
+    @Test
+    public void testPrintReaderWithoutQuoteToAppendable() throws IOException {
+        // Test to target the use of IOUtils::copy.
 
 Review comment:
   Sure. None of the other methods had Javadoc and when I initially added it as a Javadoc it was more lines than the 3 lines inside the method. It looked odd. I'll change.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services