Skip to content

Commit b1f5b42

Browse files
authored
Update mordant to 3.0 (#546)
1 parent 8626f4f commit b1f5b42

File tree

5 files changed

+17
-9
lines changed

5 files changed

+17
-9
lines changed

clikt-mordant/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ kotlin {
3131
dependencies {
3232
api(project(":clikt"))
3333
api(libs.mordant)
34+
api(libs.mordant.markdown)
3435
}
3536
}
3637

clikt-mordant/src/commonMain/kotlin/com/github/ajalt/clikt/testing/CliktTesting.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,11 @@ inline fun <T : BaseCliktCommand<T>> BaseCliktCommand<T>.test(
208208
configureContext {
209209
val originalReader = readEnvvar
210210
readEnvvar = { envvars[it] ?: (if (includeSystemEnvvars) originalReader(it) else null) }
211-
terminal = Terminal(terminal.theme, terminal.tabWidth, recorder)
211+
terminal = Terminal(
212+
theme = terminal.theme,
213+
tabWidth = terminal.tabWidth,
214+
terminalInterface = recorder
215+
)
212216
}
213217
try {
214218
parse(argv)

clikt-mordant/src/commonTest/kotlin/com/github/ajalt/clikt/parameters/PromptOptionsTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import com.github.ajalt.clikt.testing.TestCommand
1111
import com.github.ajalt.clikt.testing.test
1212
import com.github.ajalt.mordant.terminal.ConversionResult
1313
import com.github.ajalt.mordant.terminal.YesNoPrompt
14+
import com.github.ajalt.mordant.terminal.prompt
1415
import io.kotest.matchers.shouldBe
1516
import io.kotest.matchers.string.shouldContain
1617
import kotlin.js.JsName

clikt-mordant/src/commonTest/kotlin/com/github/ajalt/clikt/testing/TestingUtilsTest.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,13 @@ class TestingUtilsTest {
7878
fun `test TerminalInfo configuration`() {
7979
class C : TestCommand() {
8080
override fun run_() {
81-
with(currentContext.terminal.info) {
82-
ansiLevel shouldBe AnsiLevel.NONE
83-
width shouldBe 11
84-
height shouldBe 22
85-
ansiHyperLinks shouldBe true
86-
outputInteractive shouldBe true
87-
inputInteractive shouldBe true
81+
with(currentContext.terminal) {
82+
terminalInfo.ansiLevel shouldBe AnsiLevel.NONE
83+
size.width shouldBe 11
84+
size.height shouldBe 22
85+
terminalInfo.ansiHyperLinks shouldBe true
86+
terminalInfo.outputInteractive shouldBe true
87+
terminalInfo.inputInteractive shouldBe true
8888
}
8989
}
9090
}

gradle/libs.versions.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
[versions]
22
kotlin = "2.0.0"
33
coroutines = "1.8.1"
4+
mordant = "3.0.0"
45

56
[libraries]
6-
mordant = "com.github.ajalt.mordant:mordant:2.6.0"
7+
mordant = {module = "com.github.ajalt.mordant:mordant", version.ref = "mordant"}
8+
mordant-markdown = {module = "com.github.ajalt.mordant:mordant-markdown", version.ref = "mordant"}
79

810
# used in tests
911
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }

0 commit comments

Comments
 (0)