|
|
|
@ -71,6 +71,18 @@ public class DurationStyleTests {
|
|
|
|
|
.isEqualTo(Duration.ofNanos(-10));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void detectAndParseWhenSimpleMicrosShouldReturnDuration() {
|
|
|
|
|
assertThat(DurationStyle.detectAndParse("10us"))
|
|
|
|
|
.isEqualTo(Duration.ofNanos(10000));
|
|
|
|
|
assertThat(DurationStyle.detectAndParse("10US"))
|
|
|
|
|
.isEqualTo(Duration.ofNanos(10000));
|
|
|
|
|
assertThat(DurationStyle.detectAndParse("+10us"))
|
|
|
|
|
.isEqualTo(Duration.ofNanos(10000));
|
|
|
|
|
assertThat(DurationStyle.detectAndParse("-10us"))
|
|
|
|
|
.isEqualTo(Duration.ofNanos(-10000));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
|
public void detectAndParseWhenSimpleMillisShouldReturnDuration() {
|
|
|
|
|
assertThat(DurationStyle.detectAndParse("10ms")).isEqualTo(Duration.ofMillis(10));
|
|
|
|
|