saleemno1 commented on code in PR #626:
URL: https://github.com/apache/commons-csv/pull/626#discussion_r3671337666
##########
src/test/java/org/apache/commons/csv/CSVParserTest.java:
##########
@@ -584,6 +584,22 @@ void testEndOfFileBehaviorExcel() throws Exception {
}
}
+ @ParameterizedTest
+ @EnumSource(value = CSVFormat.Predefined.class, names = { "MySQL",
"PostgreSQLCsv", "PostgreSQLText", "Oracle" })
+ void testEscapedNullStringIsAValue(final CSVFormat.Predefined predefined)
throws Exception {
+ // "\N" is the MySQL and PostgreSQL null marker, "\\N" is the value
"\N", which is what the printer writes for it.
+ final CSVFormat format = predefined.getFormat();
+ final StringWriter writer = new StringWriter();
+ try (CSVPrinter printer = new CSVPrinter(writer, format)) {
+ printer.printRecord("\\N", null);
Review Comment:
Done. Pulled it into a local `valueEqualToNullString` so both spots
reference the same value.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]