@@ -32,13 +32,13 @@ class DateTimeComponentsFormatTest {
3232 setOffset(UtcOffset .ZERO )
3333 },
3434 format.parse(" Tue, 40 Jun 2008 11:05:30 GMT" ))
35- assertFailsWith< DateTimeFormatException > { format.parse (" Bue, 3 Jun 2008 11:05:30 GMT" ) }
35+ format.assertCanNotParse (" Bue, 3 Jun 2008 11:05:30 GMT" )
3636 }
3737
3838 @Test
3939 fun testInconsistentLocalTime () {
4040 val formatTime = LocalTime .Format {
41- hour(); char(' :' ); minute();
41+ hour(); char(' :' ); minute()
4242 chars(" (" ); amPmHour(); char(' :' ); minute(); char(' ' ); amPmMarker(" AM" , " PM" ); char(' )' )
4343 }
4444 val format = DateTimeComponents .Format { time(formatTime) }
@@ -53,16 +53,16 @@ class DateTimeComponentsFormatTest {
5353 DateTimeComponents ().apply { hour = 23 ; hourOfAmPm = 11 ; minute = 15 ; amPm = AmPmMarker .AM },
5454 format.parse(time2)
5555 )
56- assertFailsWith< IllegalArgumentException > { formatTime.parse (time2) }
56+ formatTime.assertCanNotParse (time2)
5757 val time3 = " 23:15 (10:15 PM)" // a time with an inconsistent number of hours
5858 assertDateTimeComponentsEqual(
5959 DateTimeComponents ().apply { hour = 23 ; hourOfAmPm = 10 ; minute = 15 ; amPm = AmPmMarker .PM },
6060 format.parse(time3)
6161 )
62- assertFailsWith< IllegalArgumentException > { formatTime.parse (time3) }
62+ formatTime.assertCanNotParse (time3)
6363 val time4 = " 23:15 (11:16 PM)" // a time with an inconsistently duplicated field
64- assertFailsWith< IllegalArgumentException > { format.parse (time4) }
65- assertFailsWith< IllegalArgumentException > { formatTime.parse (time4) }
64+ format.assertCanNotParse (time4)
65+ formatTime.assertCanNotParse (time4)
6666 }
6767
6868 @Test
@@ -95,7 +95,7 @@ class DateTimeComponentsFormatTest {
9595 assertEquals(dateTime, bag.toLocalDateTime())
9696 assertEquals(offset, bag.toUtcOffset())
9797 assertEquals(berlin, bag.timeZoneId)
98- assertFailsWith< DateTimeFormatException > { format.parse (" 2008-06-03T11:05:30.123456789+01:00[Mars/New_York]" ) }
98+ format.assertCanNotParse (" 2008-06-03T11:05:30.123456789+01:00[Mars/New_York]" )
9999 for (zone in TimeZone .availableZoneIds) {
100100 assertEquals(zone, format.parse(" 2008-06-03T11:05:30.123456789+01:00[$zone ]" ).timeZoneId)
101101 }
0 commit comments