Skip to content

Commit 27a439a

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent b5940a6 commit 27a439a

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/test/java/org/apache/commons/csv/CSVPrinterTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -429,14 +429,17 @@ void testQuoteCharEscapedWithQuoteModeNone() throws IOException {
429429
final StringWriter sw = new StringWriter();
430430
try (CSVPrinter printer = new CSVPrinter(sw, format)) {
431431
printer.printRecord("\"abc", "x\"y");
432+
printer.printRecord(new StringReader("\"abc"), new StringReader("x\"y"));
432433
}
433-
assertEquals("?\"abc,x?\"y\r\n", sw.toString());
434-
// The emitted record must read back as the original values.
434+
assertEquals("?\"abc,x?\"y" + RECORD_SEPARATOR + "?\"abc,x?\"y" + RECORD_SEPARATOR, sw.toString());
435+
// The emitted records must read back as the original values.
435436
try (CSVParser parser = CSVParser.parse(sw.toString(), format)) {
436437
final List<CSVRecord> records = parser.getRecords();
437-
assertEquals(1, records.size());
438-
assertEquals("\"abc", records.get(0).get(0));
439-
assertEquals("x\"y", records.get(0).get(1));
438+
assertEquals(2, records.size());
439+
for (final CSVRecord record : records) {
440+
assertEquals("\"abc", record.get(0));
441+
assertEquals("x\"y", record.get(1));
442+
}
440443
}
441444
}
442445

0 commit comments

Comments
 (0)