K2JS: add cli compiler tests for libraries
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package library.sample
|
||||
|
||||
public fun pairAdd(p: Pair<Int, Int>): Int = p.first + p.second
|
||||
|
||||
public fun pairMul(p: Pair<Int, Int>): Int = p.first * p.second
|
||||
|
||||
public data class IntHolder(val value: Int)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-library-files
|
||||
dist/jslib-example
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
@@ -0,0 +1,5 @@
|
||||
$TESTDATA_DIR$/withLib.kt
|
||||
-library-files
|
||||
dist/jslib-example.jar
|
||||
-output
|
||||
$TEMP_DIR$/out.js
|
||||
@@ -0,0 +1,8 @@
|
||||
import kotlin.Pair
|
||||
import library.sample.*
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val p = Pair(10, 20)
|
||||
val x = pairAdd(p)
|
||||
println("x=$x")
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
OK
|
||||
Reference in New Issue
Block a user