mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2024-11-22 16:23:55 +00:00
fixes in tests
This commit is contained in:
parent
c3ed1d024c
commit
fec17f949f
@ -28,10 +28,10 @@ internal class CommonNearDateTimeCalculator<T>(
|
|||||||
): Pair<DateTime, Boolean>? {
|
): Pair<DateTime, Boolean>? {
|
||||||
val currentData = partGetter(relativelyTo)
|
val currentData = partGetter(relativelyTo)
|
||||||
val greaterOrEquals = times.firstOrNull { it >= currentData }
|
val greaterOrEquals = times.firstOrNull { it >= currentData }
|
||||||
val newDateTime = if (greaterOrEquals == null) {
|
val newDateTime = when (greaterOrEquals) {
|
||||||
partSetter(relativelyTo, times.first()) ?: return null
|
null -> partSetter(relativelyTo, times.first()) ?: return null
|
||||||
} else {
|
currentData -> relativelyTo
|
||||||
partSetter(relativelyTo, greaterOrEquals) ?: return null
|
else -> partSetter(relativelyTo, greaterOrEquals) ?: return null
|
||||||
}
|
}
|
||||||
return if (newDateTime == relativelyTo) {
|
return if (newDateTime == relativelyTo) {
|
||||||
relativelyTo to false
|
relativelyTo to false
|
||||||
|
@ -80,7 +80,7 @@ class StringParseTest {
|
|||||||
}
|
}
|
||||||
@Test
|
@Test
|
||||||
fun testThatTimezoneCorrectlyDeserialized() {
|
fun testThatTimezoneCorrectlyDeserialized() {
|
||||||
val now = DateTimeTz.nowLocal()
|
val now = DateTime.now().copy(milliseconds = 0).local
|
||||||
|
|
||||||
runTest {
|
runTest {
|
||||||
for (i in 0 .. 1339) {
|
for (i in 0 .. 1339) {
|
||||||
|
Loading…
Reference in New Issue
Block a user