Henning Koehler
Henning Koehler

Reputation: 2657

Kotlin compiler does not find import kotlin.test

I'm trying to compile the following via command-line:

import kotlin.test.assertTrue
fun main(args: Array<String>) {
    assertTrue(false)
}

However, the compiler fails with:

$ kotlinc -d MyCode.jar MyCode.kt 
MyCode.kt:1:15: error: unresolved reference: test
import kotlin.test.assertTrue
              ^

What am I missing?

Upvotes: 2

Views: 1707

Answers (1)

zmunm
zmunm

Reputation: 436

Are org.jetbrains.kotlin:kotlin-test and org.jetbrains.kotlin:kotlin-test-junit specified in dependencies? kotlin.test is not a base module

Upvotes: 5

Related Questions