Minor, rename codegen tests on platformName and platformStatic

This commit is contained in:
Alexander Udalov
2015-10-23 16:02:27 +03:00
parent 18f3eb87e4
commit ae4c7b5a61
35 changed files with 196 additions and 196 deletions
@@ -0,0 +1,28 @@
import java.lang.String;
import java.lang.annotation.Annotation;
class Test {
public static String test1() throws NoSuchMethodException {
Annotation[] test1s = A.class.getMethod("test1").getAnnotations();
for (Annotation test : test1s) {
String name = test.toString();
if (name.contains("testAnnotation")) {
return "OK";
}
}
return "fail";
}
public static String test2() throws NoSuchMethodException {
Annotation[] test2s = B.class.getMethod("test1").getAnnotations();
for (Annotation test : test2s) {
String name = test.toString();
if (name.contains("testAnnotation")) {
return "OK";
}
}
return "fail";
}
}
@@ -0,0 +1,27 @@
import kotlin.jvm.JvmStatic
@Retention(AnnotationRetention.RUNTIME)
annotation class testAnnotation
class A {
companion object {
val b: String = "OK"
@JvmStatic @testAnnotation fun test1() = b
}
}
object B {
val b: String = "OK"
@JvmStatic @testAnnotation fun test1() = b
}
fun box(): String {
if (Test.test1() != "OK") return "fail 1"
if (Test.test2() != "OK") return "fail 2"
return "OK"
}
@@ -0,0 +1,19 @@
class Test {
public static String test1() {
return A.test1();
}
public static String test2() {
return A.test2();
}
public static String test3() {
return A.test3("JAVA");
}
public static String test4() {
return A.getC();
}
}
@@ -0,0 +1,28 @@
import kotlin.jvm.JvmStatic
class A {
companion object {
val b: String = "OK"
@JvmStatic val c: String = "OK"
@JvmStatic fun test1() = b
@JvmStatic fun test2() = b
@JvmStatic fun String.test3() = this + b
}
}
fun box(): String {
if (Test.test1() != "OK") return "fail 1"
if (Test.test2() != "OK") return "fail 2"
if (Test.test3() != "JAVAOK") return "fail 3"
if (Test.test4() != "OK") return "fail 4"
return "OK"
}
@@ -0,0 +1,17 @@
class Test {
public static String foo() {
return A.foo;
}
public static String bar() {
return A.bar;
}
public static String getBar() {
return A.getBar();
}
public static String baz() {
return A.baz();
}
}
@@ -0,0 +1,20 @@
import kotlin.jvm.JvmStatic
enum class A {
;
companion object {
val foo: String = "OK"
@JvmStatic val bar: String = "OK"
@JvmStatic fun baz() = foo
}
}
fun box(): String {
if (Test.foo() != "OK") return "Fail foo"
if (Test.bar() != "OK") return "Fail bar"
if (Test.getBar() != "OK") return "Fail getBar"
if (Test.baz() != "OK") return "Fail baz"
return "OK"
}
@@ -0,0 +1,19 @@
class Test {
public static String test1() {
return A.test1();
}
public static String test2() {
return A.test2();
}
public static String test3() {
return A.test3("JAVA");
}
public static String test4() {
return A.getC();
}
}
@@ -0,0 +1,26 @@
import kotlin.jvm.JvmStatic
object A {
val b: String = "OK"
@JvmStatic val c: String = "OK"
@JvmStatic fun test1() = b
@JvmStatic fun test2() = b
@JvmStatic fun String.test3() = this + b
}
fun box(): String {
if (Test.test1() != "OK") return "fail 1"
if (Test.test2() != "OK") return "fail 2"
if (Test.test3() != "JAVAOK") return "fail 3"
if (Test.test4() != "OK") return "fail 4"
return "OK"
}