Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update mordant to 3.0 #546

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clikt-mordant/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ kotlin {
dependencies {
api(project(":clikt"))
api(libs.mordant)
api(libs.mordant.markdown)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,11 @@ inline fun <T : BaseCliktCommand<T>> BaseCliktCommand<T>.test(
configureContext {
val originalReader = readEnvvar
readEnvvar = { envvars[it] ?: (if (includeSystemEnvvars) originalReader(it) else null) }
terminal = Terminal(terminal.theme, terminal.tabWidth, recorder)
terminal = Terminal(
theme = terminal.theme,
tabWidth = terminal.tabWidth,
terminalInterface = recorder
)
}
try {
parse(argv)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import com.github.ajalt.clikt.testing.TestCommand
import com.github.ajalt.clikt.testing.test
import com.github.ajalt.mordant.terminal.ConversionResult
import com.github.ajalt.mordant.terminal.YesNoPrompt
import com.github.ajalt.mordant.terminal.prompt
import io.kotest.matchers.shouldBe
import io.kotest.matchers.string.shouldContain
import kotlin.js.JsName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ class TestingUtilsTest {
fun `test TerminalInfo configuration`() {
class C : TestCommand() {
override fun run_() {
with(currentContext.terminal.info) {
ansiLevel shouldBe AnsiLevel.NONE
width shouldBe 11
height shouldBe 22
ansiHyperLinks shouldBe true
outputInteractive shouldBe true
inputInteractive shouldBe true
with(currentContext.terminal) {
terminalInfo.ansiLevel shouldBe AnsiLevel.NONE
size.width shouldBe 11
size.height shouldBe 22
terminalInfo.ansiHyperLinks shouldBe true
terminalInfo.outputInteractive shouldBe true
terminalInfo.inputInteractive shouldBe true
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[versions]
kotlin = "2.0.0"
coroutines = "1.8.1"
mordant = "3.0.0"

[libraries]
mordant = "com.github.ajalt.mordant:mordant:2.6.0"
mordant = {module = "com.github.ajalt.mordant:mordant", version.ref = "mordant"}
mordant-markdown = {module = "com.github.ajalt.mordant:mordant-markdown", version.ref = "mordant"}

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