Added import-resolve integration tests
This commit is contained in:
+59
@@ -0,0 +1,59 @@
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.multiplatform' version '{{kotlin_plugin_version}}'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
group 'com.example'
|
||||
version '0.0.1'
|
||||
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
js {
|
||||
browser {
|
||||
}
|
||||
nodejs {
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation kotlin('stdlib-common')
|
||||
}
|
||||
}
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation kotlin('test-common')
|
||||
implementation kotlin('test-annotations-common')
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation kotlin('stdlib-jdk8')
|
||||
}
|
||||
}
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation kotlin('test')
|
||||
implementation kotlin('test-junit')
|
||||
}
|
||||
}
|
||||
jsMain {
|
||||
dependencies {
|
||||
implementation kotlin('stdlib-js')
|
||||
}
|
||||
}
|
||||
jsTest {
|
||||
dependencies {
|
||||
implementation kotlin('test-js')
|
||||
}
|
||||
}
|
||||
mingwMain {
|
||||
}
|
||||
mingwTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
kotlin.code.style=official
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
rootProject.name = 'mppLibrary'
|
||||
|
||||
enableFeaturePreview('GRADLE_METADATA')
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package sample
|
||||
|
||||
expect class <lineMarker descr="Has actuals in JS, JVM">Sample</lineMarker>() {
|
||||
fun <lineMarker>checkMe</lineMarker>(): Int
|
||||
}
|
||||
|
||||
expect object <lineMarker descr="Has actuals in JS, JVM">Platform</lineMarker> {
|
||||
val <lineMarker descr="Has actuals in JS, JVM">name</lineMarker>: String
|
||||
}
|
||||
|
||||
fun hello(): String = "Hello from ${Platform.name}"
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package sample
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class <lineMarker descr="Run Test">SampleTests</lineMarker> {
|
||||
@Test
|
||||
fun <lineMarker descr="Run Test">testMe</lineMarker>() {
|
||||
assertTrue(Sample().checkMe() > 0)
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package sample
|
||||
|
||||
actual class <lineMarker descr="Has declaration in common module">Sample</lineMarker> {
|
||||
actual fun <lineMarker descr="Has declaration in common module">checkMe</lineMarker>() = 12
|
||||
}
|
||||
|
||||
actual object <lineMarker descr="Has declaration in common module">Platform</lineMarker> {
|
||||
actual val <lineMarker descr="Has declaration in common module">name</lineMarker>: String = "JS"
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package sample
|
||||
|
||||
actual class <lineMarker descr="Has declaration in common module">Sample</lineMarker> {
|
||||
actual fun <lineMarker descr="Has declaration in common module">checkMe</lineMarker>() = 42
|
||||
}
|
||||
|
||||
actual object <lineMarker descr="Has declaration in common module">Platform</lineMarker> {
|
||||
actual val <lineMarker descr="Has declaration in common module">name</lineMarker>: String = "JVM"
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package sample
|
||||
|
||||
import kotlin.test.Test
|
||||
import kotlin.test.assertTrue
|
||||
|
||||
class <lineMarker descr="Run Test">SampleTestsJVM</lineMarker> {
|
||||
@Test
|
||||
fun <lineMarker descr="Run Test">testHello</lineMarker>() {
|
||||
assertTrue("JVM" in hello())
|
||||
}
|
||||
}
|
||||
Vendored
+59
@@ -0,0 +1,59 @@
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.multiplatform' version '{{kotlin_plugin_version}}'
|
||||
}
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
group 'com.example'
|
||||
version '0.0.1'
|
||||
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
kotlin {
|
||||
jvm()
|
||||
js {
|
||||
browser {
|
||||
}
|
||||
nodejs {
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
commonMain {
|
||||
dependencies {
|
||||
implementation kotlin('stdlib-common')
|
||||
}
|
||||
}
|
||||
commonTest {
|
||||
dependencies {
|
||||
implementation kotlin('test-common')
|
||||
implementation kotlin('test-annotations-common')
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation kotlin('stdlib-jdk8')
|
||||
}
|
||||
}
|
||||
jvmTest {
|
||||
dependencies {
|
||||
implementation kotlin('test')
|
||||
implementation kotlin('test-junit')
|
||||
}
|
||||
}
|
||||
jsMain {
|
||||
dependencies {
|
||||
implementation kotlin('stdlib-js')
|
||||
}
|
||||
}
|
||||
jsTest {
|
||||
dependencies {
|
||||
implementation kotlin('test-js')
|
||||
}
|
||||
}
|
||||
mingwMain {
|
||||
}
|
||||
mingwTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
kotlin.code.style=official
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
rootProject.name = 'mppLibrary'
|
||||
|
||||
enableFeaturePreview('GRADLE_METADATA')
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package sample
|
||||
fun common(): Boolean {
|
||||
return <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is String but Boolean was expected">""</error>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package sample
|
||||
|
||||
fun js() {
|
||||
println(common())
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package sample
|
||||
|
||||
fun jvm() {
|
||||
println(common())
|
||||
println(<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: js">js</error>())
|
||||
}
|
||||
Reference in New Issue
Block a user