@@ -381,6 +381,16 @@ public void testDelimeterQuoted() throws IOException {
381381 printer .close ();
382382 }
383383
384+ @ Test
385+ public void testEOLQuoted () throws IOException {
386+ final StringWriter sw = new StringWriter ();
387+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .newBuilder ().withQuoteChar ('\'' ).build ());
388+ printer .print ("a\r b\n c" );
389+ printer .print ("x\b y\f z" );
390+ assertEquals ("'a\r b\n c',x\b y\f z" , sw .toString ());
391+ printer .close ();
392+ }
393+
384394 @ Test
385395 public void testPlainEscaped () throws IOException {
386396 final StringWriter sw = new StringWriter ();
@@ -401,6 +411,16 @@ public void testDelimiterEscaped() throws IOException {
401411 printer .close ();
402412 }
403413
414+ @ Test
415+ public void testEOLEscaped () throws IOException {
416+ final StringWriter sw = new StringWriter ();
417+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .newBuilder ().withQuoteChar (null ).withEscape ('!' ).build ());
418+ printer .print ("a\r b\n c" );
419+ printer .print ("x\f y\b z" );
420+ assertEquals ("a!rb!nc,x\f y\b z" , sw .toString ());
421+ printer .close ();
422+ }
423+
404424 @ Test
405425 public void testPlainPlain () throws IOException {
406426 final StringWriter sw = new StringWriter ();
@@ -421,4 +441,14 @@ public void testDelimiterPlain() throws IOException {
421441 printer .close ();
422442 }
423443
444+ @ Test
445+ public void testEOLPlain () throws IOException {
446+ final StringWriter sw = new StringWriter ();
447+ final CSVPrinter printer = new CSVPrinter (sw , CSVFormat .newBuilder ().withQuoteChar (null ).build ());
448+ printer .print ("a\r b\n c" );
449+ printer .print ("x\f y\b z" );
450+ assertEquals ("a\r b\n c,x\f y\b z" , sw .toString ());
451+ printer .close ();
452+ }
453+
424454}
0 commit comments