@@ -11,61 +11,59 @@ import kotlin.time.Duration.Companion.seconds
11
11
12
12
class DurationToMillisTest {
13
13
14
- @Test fun negative_duration_coerced_to_zero_millis () = assertEquals(
15
- expected = 0L ,
16
- actual = (- 1 ).seconds.toDelayMillis(),
17
- )
14
+ @Test
15
+ fun testNegativeDurationCoercedToZeroMillis () {
16
+ assertEquals( 0L , (- 1 ).seconds.toDelayMillis())
17
+ }
18
18
19
- @Test fun zero_duration_coerced_to_zero_millis () = assertEquals(
20
- expected = 0L ,
21
- actual = 0 .seconds.toDelayMillis(),
22
- )
19
+ @Test
20
+ fun testZeroDurationCoercedToZeroMillis () {
21
+ assertEquals( 0L , 0 .seconds.toDelayMillis())
22
+ }
23
23
24
- @Test fun one_nanosecond_coerced_to_one_millisecond () = assertEquals(
25
- expected = 1L ,
26
- actual = 1 .nanoseconds.toDelayMillis(),
27
- )
24
+ @Test
25
+ fun testOneNanosecondCoercedToOneMillisecond () {
26
+ assertEquals( 1L , 1 .nanoseconds.toDelayMillis())
27
+ }
28
28
29
- @Test fun one_second_coerced_to_1000_milliseconds () = assertEquals(
30
- expected = 1_000L ,
31
- actual = 1 .seconds.toDelayMillis(),
32
- )
29
+ @Test
30
+ fun testOneSecondCoercedTo1000Milliseconds () {
31
+ assertEquals( 1_000L , 1 .seconds.toDelayMillis())
32
+ }
33
33
34
- @Test fun mixed_component_duration_rounded_up_to_next_millisecond () = assertEquals(
35
- expected = 999L ,
36
- actual = (998 .milliseconds + 75909 .nanoseconds).toDelayMillis(),
37
- )
34
+ @Test
35
+ fun testMixedComponentDurationRoundedUpToNextMillisecond () {
36
+ assertEquals( 999L , (998 .milliseconds + 75909 .nanoseconds).toDelayMillis())
37
+ }
38
38
39
- @Test fun one_extra_nanosecond_rounded_up_to_next_millisecond () = assertEquals(
40
- expected = 999L ,
41
- actual = (998 .milliseconds + 1 .nanoseconds).toDelayMillis(),
42
- )
39
+ @Test
40
+ fun testOneExtraNanosecondRoundedUpToNextMillisecond () {
41
+ assertEquals( 999L , (998 .milliseconds + 1 .nanoseconds).toDelayMillis())
42
+ }
43
43
44
- @Test fun infinite_duration_coerced_to_Long_MAX_VALUE () = assertEquals(
45
- expected = Long . MAX_VALUE ,
46
- actual = Duration .INFINITE .toDelayMillis(),
47
- )
44
+ @Test
45
+ fun testInfiniteDurationCoercedToLongMaxValue () {
46
+ assertEquals( Long . MAX_VALUE , Duration .INFINITE .toDelayMillis())
47
+ }
48
48
49
- @Test fun negative_infinite_duration_coerced_to_zero () = assertEquals(
50
- expected = 0L ,
51
- actual = (- Duration .INFINITE ).toDelayMillis(),
52
- )
49
+ @Test
50
+ fun testNegativeInfiniteDurationCoercedToZero () {
51
+ assertEquals( 0L , (- Duration .INFINITE ).toDelayMillis())
52
+ }
53
53
54
- @Test fun nanosecond_off_by_one_infinity_does_not_overflow () = assertEquals(
55
- expected = Long . MAX_VALUE / 1_000_000 ,
56
- actual = (Long .MAX_VALUE - 1L ).nanoseconds.toDelayMillis(),
57
- )
54
+ @Test
55
+ fun testNanosecondOffByOneInfinityDoesNotOverflow () {
56
+ assertEquals( Long . MAX_VALUE / 1_000_000 , (Long .MAX_VALUE - 1L ).nanoseconds.toDelayMillis())
57
+ }
58
58
59
- @Test fun millisecond_off_by_one_infinity_does_not_increment () = assertEquals(
60
- expected = ( Long . MAX_VALUE / 2 ) - 1 ,
61
- actual = ((Long .MAX_VALUE / 2 ) - 1 ).milliseconds.toDelayMillis(),
62
- )
59
+ @Test
60
+ fun testMillisecondOffByOneInfinityDoesNotIncrement () {
61
+ assertEquals(( Long . MAX_VALUE / 2 ) - 1 , ((Long .MAX_VALUE / 2 ) - 1 ).milliseconds.toDelayMillis())
62
+ }
63
63
64
- @Test fun out_of_bounds_nanoseconds_but_finite_dows_not_increment () {
64
+ @Test
65
+ fun testOutOfBoundsNanosecondsButFiniteDoesNotIncrement () {
65
66
val milliseconds = Long .MAX_VALUE / 10
66
- assertEquals(
67
- expected = milliseconds,
68
- actual = milliseconds.milliseconds.toDelayMillis(),
69
- )
67
+ assertEquals(milliseconds, milliseconds.milliseconds.toDelayMillis())
70
68
}
71
69
}
0 commit comments