Skip to content

Commit

Permalink
CSV-264: Test to cover getAllowDuplicateHeaderNames.
Browse files Browse the repository at this point in the history
  • Loading branch information
SethFalco committed Dec 13, 2020
1 parent 9e72e67 commit a22ace9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/java/org/apache/commons/csv/CSVFormatTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,15 @@ public void testWithEscape() {
assertEquals(Character.valueOf('&'), formatWithEscape.getEscapeCharacter());
}

@Test
public void testWithEmptyDuplicates() {
final CSVFormat formatWithEmptyDuplicates =
CSVFormat.DEFAULT.withDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_EMPTY);

assertEquals(DuplicateHeaderMode.ALLOW_EMPTY, formatWithEmptyDuplicates.getDuplicateHeaderMode());
assertFalse(formatWithEmptyDuplicates.getAllowDuplicateHeaderNames());
}

@Test
public void testWithEscapeCRThrowsExceptions() {
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withEscape(CR));
Expand Down

0 comments on commit a22ace9

Please sign in to comment.