Skip to content

Commit

Permalink
ktl-1474 feat: add kotlinx.datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
nikpachoo committed May 8, 2024
1 parent b157563 commit 21c4fd7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions dependencies/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ dependencies {
kotlinDependency("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
kotlinDependency("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.7.3")
kotlinDependency("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4")
kotlinDependency("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0-RC.2")
kotlinJsDependency("org.jetbrains.kotlin:kotlin-stdlib-js:$kotlinVersion")
kotlinJsDependency("org.jetbrains.kotlin:kotlin-dom-api-compat:$kotlinVersion")
kotlinWasmDependency("org.jetbrains.kotlin:kotlin-stdlib-wasm-js:$kotlinVersion")
Expand Down
23 changes: 23 additions & 0 deletions src/test/kotlin/com/compiler/server/DatetimeRunnerTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.compiler.server

import com.compiler.server.base.BaseExecutorTest
import org.junit.jupiter.api.Test

class DatetimeRunnerTest : BaseExecutorTest() {
@Test
fun `kotlinx datetime basic test`() {
run(
code = """
import kotlinx.datetime.*
fun main() {
val zone = TimeZone.of("Europe/Berlin")
val today = Clock.System.todayIn(zone)
println(today.year in 2000..3000)
}
""".trimIndent(),
contains = "true"
)
}

}

0 comments on commit 21c4fd7

Please sign in to comment.