I'm trying to test my multiplatform project but I'...
# multiplatform
m
I'm trying to test my multiplatform project but I'm getting
Copy code
e: /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:
Copy code
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
Copy code
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))
        }
    }
}
j
Copy code
- implementation("org.jetbrains.kotlin:kotlin-test-common:1.6.10")
+ implementation("org.jetbrains.kotlin:kotlin-test:1.6.10")