add tests for jps-plugin (Kotlin Javascript projects)

This commit is contained in:
Michael Nedzelsky
2014-12-08 19:03:55 +03:00
parent f8f7ea8998
commit bd090d0e5f
32 changed files with 422 additions and 8 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,9 @@
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.1
Created-By: 1.7.0_72-b14 (Oracle Corporation)
Built-By: JetBrains
Implementation-Vendor: JetBrains
Implementation-Version: snapshot
Specification-Title: Kotlin JavaScript Lib
Kotlin-JS-Module-Name: jslib-example
@@ -0,0 +1,6 @@
# jslib-example
Path to sources: compiler/integration-tests/testData/ant/js/simpleWithStdlibAndFolderAsAnotherLib/jslib-example
The archive compiler/integration-tests/testData/ant/js/simpleWithStdlibAndAnotherLib/jslib-example.jar should be updated after
changing some files in source folder.
@@ -0,0 +1,37 @@
(function (Kotlin) {
'use strict';
var _ = Kotlin.defineRootPackage(null, /** @lends _ */ {
library: Kotlin.definePackage(null, /** @lends _.library */ {
sample: Kotlin.definePackage(null, /** @lends _.library.sample */ {
pairAdd_bunuun$: function (p) {
return p.first + p.second;
},
pairMul_bunuun$: function (p) {
return p.first * p.second;
},
IntHolder: Kotlin.createClass(null, function (value) {
this.value = value;
}, /** @lends _.library.sample.IntHolder.prototype */ {
component1: function () {
return this.value;
},
copy_za3lpa$: function (value) {
return new _.library.sample.IntHolder(value === void 0 ? this.value : value);
},
toString: function () {
return 'IntHolder(value=' + Kotlin.toString(this.value) + ')';
},
hashCode: function () {
var result = 0;
result = result * 31 + Kotlin.hashCode(this.value) | 0;
return result;
},
equals_za3rmp$: function (other) {
return this === other || (other !== null && (Object.getPrototypeOf(this) === Object.getPrototypeOf(other) && Kotlin.equals(this.value, other.value)));
}
})
})
})
});
Kotlin.defineModule('jslib-example', _);
}(Kotlin));
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="IDEA_JDK" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="kotlinProject" />
</component>
</module>
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<option name="DEFAULT_COMPILER" value="Javac" />
</component>
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/kotlinProject.iml" filepath="$PROJECT_DIR$/kotlinProject.iml" />
</modules>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IDEA_JDK" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
@@ -0,0 +1,7 @@
import library.sample.pairAdd
fun foo() {
val p = Pair(10, 20)
val x = pairAdd(p)
println("x=$x")
}