Skip to content

Commit

Permalink
Add extra test for invalid leap second
Browse files Browse the repository at this point in the history
  • Loading branch information
ethlo committed Mar 2, 2022
1 parent 9969a25 commit eac708b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/test/java/com/ethlo/time/CorrectnessTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ public void testParseLeapSecondUTC()
verifyLeapSecondDateTime("1990-12-31T23:59:60Z", "1991-01-01T00:00:00Z", true);
}

@Test
public void testParseDoubleLeapSecondUTC()
{
assertThrows(DateTimeException.class, () -> verifyLeapSecondDateTime("1990-12-31T23:59:61Z", "1991-01-01T00:00:01Z", true));
}

private void verifyLeapSecondDateTime(String input, String expectedInUtc, boolean isVerifiedLeapSecond)
{
final LeapSecondException exc = getLeapSecondsException(input);
Expand Down

0 comments on commit eac708b

Please sign in to comment.