Skip to content

Commit ca2e6e7

Browse files
committed
Add missing tests
1 parent 0b0003e commit ca2e6e7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ private CSVPrinter printWithHeaderComments(final StringWriter sw, final Date now
183183
// Use withHeaderComments first to test CSV-145
184184
// @formatter:off
185185
final CSVFormat format = baseFormat.builder()
186+
.setHeaderComments((String[]) null) // don't blow up
187+
.setHeaderComments((Object[]) null) // don't blow up
186188
.setHeaderComments("Generated by Apache Commons CSV 1.1", now)
187189
.setCommentMarker('#')
188190
.setHeader("Col1", "Col2")
@@ -500,6 +502,15 @@ public void testEolQuoted() throws IOException {
500502
}
501503
}
502504

505+
@SuppressWarnings("unlikely-arg-type")
506+
@Test
507+
public void testEquals() throws IOException {
508+
// Don't use assertNotEquals here
509+
assertFalse(CSVFormat.DEFAULT.equals(null));
510+
// Don't use assertNotEquals here
511+
assertFalse(CSVFormat.DEFAULT.equals(""));
512+
}
513+
503514
@Test
504515
public void testEscapeBackslash1() throws IOException {
505516
final StringWriter sw = new StringWriter();

0 commit comments

Comments
 (0)