Skip to content

Commit 9d2bbc8

Browse files
committed
PDFBOX-5660: increase coverage
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1924676 13f79535-47bb-0310-9956-ffa450edef68
1 parent d0cde3a commit 9d2bbc8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

xmpbox/src/test/java/org/apache/xmpbox/DateConverterTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121

2222
package org.apache.xmpbox;
2323

24+
import java.io.IOException;
25+
2426
import static org.junit.jupiter.api.Assertions.assertEquals;
27+
import static org.junit.jupiter.api.Assertions.assertThrows;
2528

2629
import java.text.SimpleDateFormat;
2730
import java.time.ZonedDateTime;
@@ -52,6 +55,11 @@ void testDateConversion() throws Exception
5255
Calendar convDate = DateConverter.toCalendar("2015-02-02");
5356
assertEquals(2015, convDate.get(Calendar.YEAR));
5457

58+
convDate = DateConverter.toCalendar("D:2015-02-02");
59+
assertEquals(2015, convDate.get(Calendar.YEAR));
60+
61+
assertThrows(IOException.class, () -> DateConverter.toCalendar("123"));
62+
5563
//Test missing seconds
5664
assertEquals(DateConverter.toCalendar("2015-12-08T12:07:00-05:00"),
5765
DateConverter.toCalendar("2015-12-08T12:07-05:00"));

0 commit comments

Comments
 (0)