[CSV-130] CSVFormat#withHeader doesn't work well with #printComment, add withHeaderComments(String...). Adjust test for style.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1623985 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a4f737108b
commit
e650b9d699
|
@ -517,9 +517,9 @@ public class CSVPrinterTest {
|
|||
csvPrinter.close();
|
||||
}
|
||||
|
||||
private CSVPrinter printWithHeaderComments(final StringWriter sw, Date now, CSVFormat format)
|
||||
private CSVPrinter printWithHeaderComments(final StringWriter sw, Date now, CSVFormat baseFormat)
|
||||
throws IOException {
|
||||
format = format.withCommentMarker('#').withHeader("Col1", "Col2");
|
||||
CSVFormat format = baseFormat.withCommentMarker('#').withHeader("Col1", "Col2");
|
||||
format = format.withHeaderComments("Generated by Apache Commons CSV 1.1", now);
|
||||
final CSVPrinter csvPrinter = format.print(sw);
|
||||
csvPrinter.printRecord("A", "B");
|
||||
|
|
Loading…
Reference in New Issue