@@ -1802,18 +1802,20 @@ void testQuoteAll() throws IOException {
18021802 void testQuoteCharEscapedWithQuoteModeNone () throws IOException {
18031803 final CSVFormat format = CSVFormat .DEFAULT .builder ().setQuote ('"' ).setEscape ('?' ).setQuoteMode (QuoteMode .NONE ).get ();
18041804 final StringWriter sw = new StringWriter ();
1805+ final String col1 = "\" abc" ;
1806+ final String col2 = "x\" y" ;
18051807 try (CSVPrinter printer = new CSVPrinter (sw , format )) {
1806- printer .printRecord (" \" abc" , "x \" y" );
1807- printer .printRecord (new StringReader (" \" abc" ), new StringReader ("x \" y" ));
1808+ printer .printRecord (col1 , col2 );
1809+ printer .printRecord (new StringReader (col1 ), new StringReader (col2 ));
18081810 }
18091811 assertEquals ("?\" abc,x?\" y" + RECORD_SEPARATOR + "?\" abc,x?\" y" + RECORD_SEPARATOR , sw .toString ());
18101812 // The emitted records must read back as the original values.
18111813 try (CSVParser parser = CSVParser .parse (sw .toString (), format )) {
18121814 final List <CSVRecord > records = parser .getRecords ();
18131815 assertEquals (2 , records .size ());
18141816 for (final CSVRecord record : records ) {
1815- assertEquals (" \" abc" , record .get (0 ));
1816- assertEquals ("x \" y" , record .get (1 ));
1817+ assertEquals (col1 , record .get (0 ));
1818+ assertEquals (col2 , record .get (1 ));
18171819 }
18181820 }
18191821 }
0 commit comments