commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1700391 - /commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java
Date Tue, 01 Sep 2015 05:33:05 GMT
Author: ggregory
Date: Tue Sep  1 05:33:05 2015
New Revision: 1700391

URL: http://svn.apache.org/r1700391
Log:
Test CSV-154.

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

Modified: commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java
URL: http://svn.apache.org/viewvc/commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java?rev=1700391&r1=1700390&r2=1700391&view=diff
==============================================================================
--- commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java (original)
+++ commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVFormatTest.java Tue Sep
 1 05:33:05 2015
@@ -377,10 +377,22 @@ public class CSVFormatTest {
     }
 
     @Test
-    public void testJIraCsv154() throws IOException {
+    public void testJiraCsv154_withCommentMarker() throws IOException {
         final String comment = "This is a header comment";
-        CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withCommentMarker('#')
-                .withHeaderComments(comment);
+        CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withCommentMarker('#').withHeaderComments(comment);
+        StringBuilder out = new StringBuilder();
+        final CSVPrinter printer = format.print(out);
+        printer.print("A");
+        printer.print("B");
+        printer.close();
+        String s = out.toString();
+        Assert.assertTrue(s, s.contains(comment));
+    }
+
+    @Test
+    public void testJiraCsv154_withHeaderComments() throws IOException {
+        final String comment = "This is a header comment";
+        CSVFormat format = CSVFormat.EXCEL.withHeader("H1", "H2").withHeaderComments(comment).withCommentMarker('#');
         StringBuilder out = new StringBuilder();
         final CSVPrinter printer = format.print(out);
         printer.print("A");



Mime
View raw message