martmists
02/01/2022, 2:23 PMe: /home/mart/git/command_parser/src/commonTest/kotlin/CommandTests.kt: (7, 15): Unresolved reference: test
e: /home/mart/git/command_parser/src/commonTest/kotlin/CommandTests.kt: (8, 15): Unresolved reference: test
e: /home/mart/git/command_parser/src/commonTest/kotlin/CommandTests.kt: (11, 6): Unresolved reference: Test
e: /home/mart/git/command_parser/src/commonTest/kotlin/CommandTests.kt: (23, 13): Unresolved reference: assertTrue
despite having this in my build.gradle.kts:
val commonTest by getting {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-test-common:1.6.10")
implementation("org.jetbrains.kotlin:kotlin-test-annotations-common:1.6.10")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0")
}
}
and the code for testing is
import com.martmists.commandparser.dispatch.Context
import com.martmists.commandparser.dispatch.Dispatcher
import com.martmists.commandparser.dsl.build
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.*
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertTrue
class CommandTests {
@Test
fun testNoArgs() = runTest {
launch(Dispatchers.Main) {
val dispatcher = Dispatcher<Context>()
build(dispatcher) {
command("test") {
action {
println("test success")
}
}
}
val ctx = Context("test")
assertTrue(dispatcher.dispatch(ctx))
}
}
}
Javier
02/01/2022, 3:01 PM- implementation("org.jetbrains.kotlin:kotlin-test-common:1.6.10")
+ implementation("org.jetbrains.kotlin:kotlin-test:1.6.10")