fixes in tests

This commit is contained in:
InsanusMokrassar 2021-06-03 12:37:13 +06:00
parent c3ed1d024c
commit fec17f949f
2 changed files with 5 additions and 5 deletions

View File

@ -28,10 +28,10 @@ internal class CommonNearDateTimeCalculator<T>(
): Pair<DateTime, Boolean>? {
val currentData = partGetter(relativelyTo)
val greaterOrEquals = times.firstOrNull { it >= currentData }
val newDateTime = if (greaterOrEquals == null) {
partSetter(relativelyTo, times.first()) ?: return null
} else {
partSetter(relativelyTo, greaterOrEquals) ?: return null
val newDateTime = when (greaterOrEquals) {
null -> partSetter(relativelyTo, times.first()) ?: return null
currentData -> relativelyTo
else -> partSetter(relativelyTo, greaterOrEquals) ?: return null
}
return if (newDateTime == relativelyTo) {
relativelyTo to false

View File

@ -80,7 +80,7 @@ class StringParseTest {
}
@Test
fun testThatTimezoneCorrectlyDeserialized() {
val now = DateTimeTz.nowLocal()
val now = DateTime.now().copy(milliseconds = 0).local
runTest {
for (i in 0 .. 1339) {