add offset parameter in strings

This commit is contained in:
2021-03-30 14:07:39 +06:00
parent 93246cada7
commit a07027399c
11 changed files with 130 additions and 12 deletions

View File

@@ -1,6 +1,8 @@
package dev.inmo.krontab.utils
import com.soywiz.klock.DateTimeTz
import dev.inmo.krontab.buildSchedule
import dev.inmo.krontab.internal.offsetRange
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.collect
import kotlinx.coroutines.flow.takeWhile
@@ -76,4 +78,16 @@ class StringParseTest {
assertEquals(expectedCollects, collected)
}
}
@Test
fun testThatTimezoneCorrectlyDeserialized() {
val now = DateTimeTz.nowLocal()
runTest {
for (i in offsetRange) {
val kronScheduler = buildSchedule("* * 10 * * ${i}o")
val next = kronScheduler.next(now)
}
}
}
}