File tree Expand file tree Collapse file tree
src/test/java/org/apache/commons/csv Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -377,10 +377,22 @@ public void testWithHeader() throws Exception {
377377 }
378378
379379 @ Test
380- public void testJIraCsv154 () throws IOException {
380+ public void testJiraCsv154_withCommentMarker () throws IOException {
381381 final String comment = "This is a header comment" ;
382- CSVFormat format = CSVFormat .EXCEL .withHeader ("H1" , "H2" ).withCommentMarker ('#' )
383- .withHeaderComments (comment );
382+ CSVFormat format = CSVFormat .EXCEL .withHeader ("H1" , "H2" ).withCommentMarker ('#' ).withHeaderComments (comment );
383+ StringBuilder out = new StringBuilder ();
384+ final CSVPrinter printer = format .print (out );
385+ printer .print ("A" );
386+ printer .print ("B" );
387+ printer .close ();
388+ String s = out .toString ();
389+ Assert .assertTrue (s , s .contains (comment ));
390+ }
391+
392+ @ Test
393+ public void testJiraCsv154_withHeaderComments () throws IOException {
394+ final String comment = "This is a header comment" ;
395+ CSVFormat format = CSVFormat .EXCEL .withHeader ("H1" , "H2" ).withHeaderComments (comment ).withCommentMarker ('#' );
384396 StringBuilder out = new StringBuilder ();
385397 final CSVPrinter printer = format .print (out );
386398 printer .print ("A" );
You can’t perform that action at this time.
0 commit comments