Skip to content

Commit 9590db2

Browse files
committed
CSV-264: Test to cover getAllowDuplicateHeaderNames.
1 parent 6d33ab6 commit 9590db2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,15 @@ public void testWithEscape() {
930930
assertEquals(Character.valueOf('&'), formatWithEscape.getEscapeCharacter());
931931
}
932932

933+
@Test
934+
public void testWithEmptyDuplicates() {
935+
final CSVFormat formatWithEmptyDuplicates =
936+
CSVFormat.DEFAULT.withDuplicateHeaderMode(DuplicateHeaderMode.ALLOW_EMPTY);
937+
938+
assertEquals(DuplicateHeaderMode.ALLOW_EMPTY, formatWithEmptyDuplicates.getDuplicateHeaderMode());
939+
assertFalse(formatWithEmptyDuplicates.getAllowDuplicateHeaderNames());
940+
}
941+
933942
@Test
934943
public void testWithEscapeCRThrowsExceptions() {
935944
assertThrows(IllegalArgumentException.class, () -> CSVFormat.DEFAULT.withEscape(CR));

0 commit comments

Comments
 (0)