JS: do not use "-no-stdlib" in non-relevant tests
Rename some Ant tests: "simple[...]" -> "simpleWithoutStdlib[...]" and "simpleWithStdlib[...]" -> "simple[...]"
This commit is contained in:
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
OUT:
|
||||
Buildfile: [TestData]/build.xml
|
||||
|
||||
build:
|
||||
[mkdir] Created dir: [Temp]/lib
|
||||
[kotlin2js] Compiling [[TestData]/jslib-example1] => [[Temp]/lib/jslib-example1.js]
|
||||
[kotlin2js] Compiling [[TestData]/jslib-example2] => [[Temp]/lib/jslib-example2.js]
|
||||
[delete] Deleting: [Temp]/lib/jslib-example1.js
|
||||
[delete] Deleting: [Temp]/lib/jslib-example2.js
|
||||
[delete] Deleting: [Temp]/lib/jslib-example1.meta.js
|
||||
[delete] Deleting: [Temp]/lib/jslib-example2.meta.js
|
||||
[kotlin2js] Compiling [[TestData]/root1] => [[Temp]/out.js]
|
||||
[copy] Copying 1 file to [Temp]
|
||||
|
||||
BUILD SUCCESSFUL
|
||||
Total time: [time]
|
||||
|
||||
Return code: 0
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
<project name="Ant Task Test" default="build">
|
||||
<taskdef resource="org/jetbrains/kotlin/ant/antlib.xml" classpath="${kotlin.lib}/kotlin-ant.jar"/>
|
||||
<property name="library.path1" value="${test.data}/jslib-example1"/>
|
||||
<property name="library.path2" value="${test.data}/jslib-example2"/>
|
||||
<property name="temp.library.path" value="${temp}/lib"/>
|
||||
<target name="build">
|
||||
<mkdir dir="${temp.library.path}"/>
|
||||
|
||||
<kotlin2js src="${library.path1}" output="${temp.library.path}/jslib-example1.js" metaInfo="true"/>
|
||||
<kotlin2js src="${library.path2}" output="${temp.library.path}/jslib-example2.js" metaInfo="true">
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example1.meta.js"/>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
|
||||
<concat destfile="${temp.library.path}/jslib-example.js">
|
||||
<fileset file="${temp.library.path}/jslib-example1.js"/>
|
||||
<fileset file="${temp.library.path}/jslib-example2.js"/>
|
||||
<fileset file="${temp.library.path}/jslib-example1.meta.js"/>
|
||||
<fileset file="${temp.library.path}/jslib-example2.meta.js"/>
|
||||
</concat>
|
||||
|
||||
<delete file="${temp.library.path}/jslib-example1.js"/>
|
||||
<delete file="${temp.library.path}/jslib-example2.js"/>
|
||||
<delete file="${temp.library.path}/jslib-example1.meta.js"/>
|
||||
<delete file="${temp.library.path}/jslib-example2.meta.js"/>
|
||||
|
||||
<kotlin2js src="${test.data}/root1" output="${temp}/out.js" main="call">
|
||||
<libraries>
|
||||
<pathelement path="${temp.library.path}/jslib-example.js"/>
|
||||
</libraries>
|
||||
</kotlin2js>
|
||||
<copy todir="${temp}">
|
||||
<fileset dir="${temp.library.path}">
|
||||
<include name="**/*.js"/>
|
||||
<exclude name="META-INF/**"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
</target>
|
||||
</project>
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package library.sample
|
||||
|
||||
import kotlin.js.Date
|
||||
|
||||
public class ClassA() {
|
||||
val value: Int = 100
|
||||
}
|
||||
|
||||
public fun Date.extFun(): String = "Date.extFun"
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package library.sample
|
||||
|
||||
public fun ClassA.extFun(): String = "ClassA.extFun"
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package foo
|
||||
|
||||
import library.sample.*
|
||||
import kotlin.js.Date
|
||||
|
||||
var ok = "FAIL"
|
||||
|
||||
fun main() {
|
||||
val x = ClassA().value
|
||||
if (x == 100 && Date().extFun() == "Date.extFun" && ClassA().extFun() == "ClassA.extFun") {
|
||||
ok = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String = ok
|
||||
Reference in New Issue
Block a user