mirror of
https://github.com/InsanusMokrassar/krontab.git
synced 2025-12-05 20:45:48 +00:00
files replacements
This commit is contained in:
23
src/commonTest/kotlin/CheckMonthsAndDaysCorrectWork.kt
Normal file
23
src/commonTest/kotlin/CheckMonthsAndDaysCorrectWork.kt
Normal file
@@ -0,0 +1,23 @@
|
||||
package dev.inmo.krontab.utils
|
||||
|
||||
import korlibs.time.DateTime
|
||||
import korlibs.time.days
|
||||
import dev.inmo.krontab.buildSchedule
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import kotlin.test.*
|
||||
|
||||
class CheckMonthsAndDaysCorrectWork {
|
||||
@Test
|
||||
fun checkMonthsAndDaysCorrectWork() {
|
||||
val now = DateTime.now().startOfYear.startOfDay
|
||||
for (i in 0 until now.year.days) {
|
||||
val scheduleDateTime = (now + i.days)
|
||||
runTest {
|
||||
assertEquals(
|
||||
scheduleDateTime,
|
||||
buildSchedule("0 0 0 ${scheduleDateTime.dayOfMonth - 1} ${scheduleDateTime.month0}").next(now)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user