Skip to content

Commit

Permalink
KTL-1617 Add dependency on kotlinx-io-bytestring
Browse files Browse the repository at this point in the history
  • Loading branch information
fzhinkin authored and dkrasnoff committed Sep 4, 2024
1 parent 5c74774 commit 163210d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
1 change: 1 addition & 0 deletions dependencies/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ dependencies {
kotlinDependency(libs.kotlinx.coroutines.core.jvm)
kotlinDependency(libs.kotlinx.coroutines.test)
kotlinDependency(libs.kotlinx.datetime)
kotlinDependency(libs.kotlinx.io.bytestring)
kotlinDependency(libs.kotlinx.io.core)
kotlinDependency(libs.kotlinx.serialization.json.jvm)
kotlinDependency(libs.kotlinx.serialization.core.jvm)
Expand Down
5 changes: 3 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trove4j = "1.0.20221201"
kotlinx-coroutines = "1.7.3"
kotlinx-coroutines-test = "1.6.4"
kotlinx-datetime = "0.6.0-RC.2"
kotlinx-io-core = "0.5.1"
kotlinx-io = "0.5.1"
kotlinx-serialization = "1.7.1"
skiko = "0.7.90"
# don't forget to update jackson version in `executor.policy` file.
Expand Down Expand Up @@ -40,7 +40,8 @@ kotlin-core = { group = "org.jetbrains.kotlin", name = "core", version.ref = "ko
kotlinx-coroutines-core-jvm = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-core-jvm", version.ref = "kotlinx-coroutines" }
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "kotlinx-coroutines-test" }
kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinx-datetime" }
kotlinx-io-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-io-core", version.ref = "kotlinx-io-core" }
kotlinx-io-bytestring = { group = "org.jetbrains.kotlinx", name = "kotlinx-io-bytestring", version.ref = "kotlinx-io" }
kotlinx-io-core = { group = "org.jetbrains.kotlinx", name = "kotlinx-io-core", version.ref = "kotlinx-io" }
kotlinx-serialization-json-jvm = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json-jvm", version.ref = "kotlinx-serialization" }
kotlinx-serialization-core-jvm = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-core-jvm", version.ref = "kotlinx-serialization" }
springfox-boot-starter = { group = "io.springfox", name = "springfox-boot-starter", version.ref = "springfox-boot-starter" }
Expand Down
17 changes: 17 additions & 0 deletions src/test/kotlin/com/compiler/server/IORunnerTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,21 @@ class IORunnerTest : BaseExecutorTest() {
contains = "<outStream>Hello world"
)
}

@Test
fun `kotlinx io bytestring test`() {
run (
code = """
import kotlinx.io.*
import kotlinx.io.bytestring.*
fun main() {
val str = ByteString("Hello world".encodeToByteArray())
val buffer = Buffer().also { it.write(str) }
println(buffer.readString())
}
""".trimIndent(),
contains = "<outStream>Hello world"
)
}
}

0 comments on commit 163210d

Please sign in to comment.