K2JS: add cli compiler tests for libraries

This commit is contained in:
Michael Nedzelsky
2014-11-19 16:31:47 +03:00
parent 103307432e
commit ecc0751221
9 changed files with 85 additions and 0 deletions
@@ -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
+5
View File
@@ -0,0 +1,5 @@
$TESTDATA_DIR$/withLib.kt
-library-files
dist/jslib-example.jar
-output
$TEMP_DIR$/out.js
+8
View File
@@ -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")
}
+1
View File
@@ -0,0 +1 @@
OK