Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
* Ktor 2.3.3 -> 2.3.4
* kotlinx-datetime 0.4.0 -> 0.4.1
* Dokka 1.8.20 -> 1.9.0
  • Loading branch information
lukellmann committed Sep 2, 2023
1 parent 84aa40f commit 767dabe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import kotlin.js.JsName
import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.time.Duration
import kotlin.time.Duration.Companion.nanoseconds
import kotlin.time.Duration.Companion.seconds

private val EPOCH = Instant.fromEpochSeconds(0)

Expand Down Expand Up @@ -74,11 +72,6 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest(
instant = Instant.fromEpochMilliseconds(796514689159),
serializer = InstantInEpochMillisecondsSerializer,
) {
// workaround for https://github.com/Kotlin/kotlinx-datetime/issues/263, use normal operators when fix is released
private infix fun Instant.plus(duration: Duration) = (this + 1.seconds) - (1.seconds - duration)
private infix fun Instant.minus(duration: Duration) = (this - 1.seconds) + (1.seconds - duration)


private val past = Instant.fromEpochMilliseconds(Long.MIN_VALUE)
private val future = Instant.fromEpochMilliseconds(Long.MAX_VALUE)

Expand All @@ -94,7 +87,7 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest(
fun `future Instant under limit can be serialized`() {
assertEquals(
expected = (if (futureClamped) clampedMax else Long.MAX_VALUE - 1).toString(),
actual = serialize(future minus 1.nanoseconds),
actual = serialize(future - 1.nanoseconds),
)
}

Expand All @@ -103,7 +96,7 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest(
fun `past Instant under limit can be serialized`() {
assertEquals(
expected = (if (pastClamped) clampedMin else Long.MIN_VALUE).toString(),
actual = serialize(past plus 1.nanoseconds),
actual = serialize(past + 1.nanoseconds),
)
}

Expand All @@ -130,13 +123,13 @@ class InstantInEpochMillisecondsSerializerTest : InstantSerializerTest(
@Test
@JsName("test11")
fun `future Instant over limit cannot be serialized`() {
if (!futureClamped) assertFailsWith<SerializationException> { serialize(future plus 1.nanoseconds) }
if (!futureClamped) assertFailsWith<SerializationException> { serialize(future + 1.nanoseconds) }
}

@Test
@JsName("test12")
fun `past Instant over limit cannot be serialized`() {
if (!pastClamped) assertFailsWith<SerializationException> { serialize(past minus 1.nanoseconds) }
if (!pastClamped) assertFailsWith<SerializationException> { serialize(past - 1.nanoseconds) }
}
}

Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

# api dependencies
kotlin = "1.9.10" # https://github.com/JetBrains/kotlin
ktor = "2.3.3" # https://github.com/ktorio/ktor
ktor = "2.3.4" # https://github.com/ktorio/ktor
kotlinx-coroutines = "1.7.3" # https://github.com/Kotlin/kotlinx.coroutines
kotlinx-serialization = "1.6.0" # https://github.com/Kotlin/kotlinx.serialization
kotlinx-datetime = "0.4.0" # https://github.com/Kotlin/kotlinx-datetime
kotlinx-datetime = "0.4.1" # https://github.com/Kotlin/kotlinx-datetime
kotlin-logging = "3.0.5" # https://github.com/oshai/kotlin-logging
kord-cache = "0.4.0" # https://github.com/kordlib/cache

Expand All @@ -25,7 +25,7 @@ mockk = "1.13.7" # https://github.com/mockk/mockk
slf4j = "2.0.7" # https://www.slf4j.org

# plugins
dokka = "1.8.20" # https://github.com/Kotlin/dokka
dokka = "1.9.0" # https://github.com/Kotlin/dokka
kotlinx-atomicfu = "0.22.0" # https://github.com/Kotlin/kotlinx-atomicfu
binary-compatibility-validator = "0.13.2" # https://github.com/Kotlin/binary-compatibility-validator
buildconfig = "4.1.2" # https://github.com/gmazzo/gradle-buildconfig-plugin
Expand Down

0 comments on commit 767dabe

Please sign in to comment.