Merge boxWithStdlib testData into box, delete BoxWithStdlib test

This commit is contained in:
Alexander Udalov
2016-03-07 13:36:14 +03:00
committed by Alexander Udalov
parent 22bfc9786a
commit 06a67e6602
535 changed files with 3520 additions and 3871 deletions
+14
View File
@@ -0,0 +1,14 @@
// WITH_RUNTIME
package test
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(val c1: Int)
@Ann('a' - 'a') class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.c1 != 0) return "fail : expected = ${1}, actual = ${annotation.c1}"
return "OK"
}
+22
View File
@@ -0,0 +1,22 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val b: Byte,
val s: Short,
val i: Int,
val l: Long
)
@Ann(1 / 1, 1 / 1, 1 / 1, 1 / 1) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.b != 1.toByte()) return "fail 1"
if (annotation.s != 1.toShort()) return "fail 2"
if (annotation.i != 1) return "fail 2"
if (annotation.l != 1.toLong()) return "fail 2"
return "OK"
}
// EXPECTED: Ann[b = IntegerValueType(1): IntegerValueType(1), i = IntegerValueType(1): IntegerValueType(1), l = IntegerValueType(1): IntegerValueType(1), s = IntegerValueType(1): IntegerValueType(1)]
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Int,
val p2: Short,
val p3: Byte,
val p4: Int,
val p5: Int,
val p6: Int
)
val prop1: Int = 1 or 1
val prop2: Short = 1 and 1
val prop3: Byte = 1 xor 1
val prop4: Int = 1 shl 1
val prop5: Int = 1 shr 1
val prop6: Int = 1 ushr 1
@Ann(1 or 1, 1 and 1, 1 xor 1, 1 shl 1, 1 shr 1, 1 ushr 1) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}
+20
View File
@@ -0,0 +1,20 @@
// WITH_RUNTIME
abstract class BaseClass {
protected open val menuId: Int = 0
public fun run(): Pair<String, Boolean> =
"$menuId" to (menuId == 0)
}
class ImplClass: BaseClass() {
override val menuId: Int = 3
}
public fun box(): String {
val result = ImplClass().run()
if (result != ("3" to false)) return "Fail: $result"
return "OK"
}
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Int,
val p2: Int,
val p3: Int,
val p4: Int,
val p5: Long,
val p6: Long
)
@Ann(
p1 = java.lang.Byte.MAX_VALUE + 1,
p2 = java.lang.Short.MAX_VALUE + 1,
p3 = java.lang.Integer.MAX_VALUE + 1,
p4 = java.lang.Integer.MAX_VALUE + 1,
p5 = java.lang.Integer.MAX_VALUE + 1.toLong(),
p6 = java.lang.Long.MAX_VALUE + 1
) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != 128) return "fail 1, expected = ${128}, actual = ${annotation.p1}"
if (annotation.p2 != 32768) return "fail 2, expected = ${32768}, actual = ${annotation.p2}"
if (annotation.p3 != -2147483648) return "fail 3, expected = ${-2147483648}, actual = ${annotation.p3}"
if (annotation.p4 != -2147483648) return "fail 4, expected = ${-2147483648}, actual = ${annotation.p4}"
if (annotation.p5 != 2147483648.toLong()) return "fail 5, expected = ${2147483648}, actual = ${annotation.p5}"
if (annotation.p6 != java.lang.Long.MAX_VALUE + 1) return "fail 5, expected = ${java.lang.Long.MAX_VALUE + 1}, actual = ${annotation.p6}"
return "OK"
}
+25
View File
@@ -0,0 +1,25 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Int,
val p2: Byte,
val p4: Int,
val p5: Int
)
@Ann(
p1 = java.lang.Byte.MAX_VALUE + 1,
p2 = 1 + 1,
p4 = 1 + 1,
p5 = 1.toByte() + 1
) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != 128) return "fail 1, expected = ${128}, actual = ${annotation.p1}"
if (annotation.p2 != 2.toByte()) return "fail 2, expected = ${2}, actual = ${annotation.p2}"
if (annotation.p4 != 2) return "fail 4, expected = ${2}, actual = ${annotation.p4}"
if (annotation.p5 != 2) return "fail 5, expected = ${2}, actual = ${annotation.p5}"
return "OK"
}
+25
View File
@@ -0,0 +1,25 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Int,
val p2: Int,
val p4: Long,
val p5: Int
)
@Ann(
p1 = java.lang.Integer.MAX_VALUE + 1,
p2 = 1 + 1,
p4 = 1 + 1,
p5 = 1.toInt() + 1.toInt()
) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != -2147483648) return "fail 1, expected = ${-2147483648}, actual = ${annotation.p1}"
if (annotation.p2 != 2) return "fail 2, expected = ${2}, actual = ${annotation.p2}"
if (annotation.p4 != 2.toLong()) return "fail 4, expected = ${2}, actual = ${annotation.p4}"
if (annotation.p5 != 2) return "fail 5, expected = ${2}, actual = ${annotation.p5}"
return "OK"
}
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Byte,
val p2: Short,
val p3: Int,
val p4: Long,
val p5: Double,
val p6: Float
)
val prop1: Byte = 1 - 1
val prop2: Short = 1 - 1
val prop3: Int = 1 - 1
val prop4: Long = 1 - 1
val prop5: Double = 1.0 - 1.0
val prop6: Float = 1.0.toFloat() - 1.0.toFloat()
@Ann(1 - 1, 1 - 1, 1 - 1, 1 - 1, 1.0 - 1.0, 1.0.toFloat() - 1.0.toFloat()) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Byte,
val p2: Short,
val p3: Int,
val p4: Long,
val p5: Double,
val p6: Float
)
val prop1: Byte = 1 % 1
val prop2: Short = 1 % 1
val prop3: Int = 1 % 1
val prop4: Long = 1 % 1
val prop5: Double = 1.0 % 1.0
val prop6: Float = 1.0.toFloat() % 1.0.toFloat()
@Ann(1 % 1, 1 % 1, 1 % 1, 1 % 1, 1.0 % 1.0, 1.0.toFloat() % 1.0.toFloat()) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Byte,
val p2: Short,
val p3: Int,
val p4: Long,
val p5: Double,
val p6: Float
)
val prop1: Byte = 1 * 1
val prop2: Short = 1 * 1
val prop3: Int = 1 * 1
val prop4: Long = 1 * 1
val prop5: Double = 1.0 * 1.0
val prop6: Float = 1.0.toFloat() * 1.0.toFloat()
@Ann(1 * 1, 1 * 1, 1 * 1, 1 * 1, 1.0 * 1.0, 1.0.toFloat() * 1.0.toFloat()) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Byte,
val p2: Short,
val p3: Int,
val p4: Long,
val p5: Double,
val p6: Float
)
val prop1: Byte = (1 + 2) * 2
val prop2: Short = (1 + 2) * 2
val prop3: Int = (1 + 2) * 2
val prop4: Long = (1 + 2) * 2
val prop5: Double = (1.0 + 2) * 2
val prop6: Float = (1.toFloat() + 2) * 2
@Ann((1 + 2) * 2, (1 + 2) * 2, (1 + 2) * 2, (1 + 2) * 2, (1.0 + 2) * 2, (1.toFloat() + 2) * 2) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Byte,
val p2: Short,
val p3: Int,
val p4: Long,
val p5: Double,
val p6: Float
)
val prop1: Byte = 1 + 1
val prop2: Short = 1 + 1
val prop3: Int = 1 + 1
val prop4: Long = 1 + 1
val prop5: Double = 1.0 + 1.0
val prop6: Float = 1.0.toFloat() + 1.0.toFloat()
@Ann(1 + 1, 1 + 1, 1 + 1, 1 + 1, 1.0 + 1.0, 1.0.toFloat() + 1.0.toFloat()) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}
@@ -0,0 +1,28 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Int,
val p2: Int,
val p3: Int,
val p4: Int,
val p5: Int
)
const val prop1: Int = 1.plus(1)
const val prop2: Int = 1.minus(1)
const val prop3: Int = 1.times(1)
const val prop4: Int = 1.div(1)
const val prop5: Int = 1.mod(1)
@Ann(prop1, prop2, prop3, prop4, prop5) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
return "OK"
}
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Byte,
val p2: Short,
val p3: Int,
val p4: Long,
val p5: Double,
val p6: Float
)
const val prop1: Byte = -1
const val prop2: Short = -1
const val prop3: Int = -1
const val prop4: Long = -1
const val prop5: Double = -1.0
const val prop6: Float = -1.0.toFloat()
@Ann(prop1, prop2, prop3, prop4, prop5, prop6) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}
+31
View File
@@ -0,0 +1,31 @@
// WITH_RUNTIME
@Retention(AnnotationRetention.RUNTIME)
annotation class Ann(
val p1: Byte,
val p2: Short,
val p3: Int,
val p4: Long,
val p5: Double,
val p6: Float
)
const val prop1: Byte = +1
const val prop2: Short = +1
const val prop3: Int = +1
const val prop4: Long = +1
const val prop5: Double = +1.0
const val prop6: Float = +1.0.toFloat()
@Ann(prop1, prop2, prop3, prop4, prop5, prop6) class MyClass
fun box(): String {
val annotation = MyClass::class.java.getAnnotation(Ann::class.java)!!
if (annotation.p1 != prop1) return "fail 1, expected = ${prop1}, actual = ${annotation.p1}"
if (annotation.p2 != prop2) return "fail 2, expected = ${prop2}, actual = ${annotation.p2}"
if (annotation.p3 != prop3) return "fail 3, expected = ${prop3}, actual = ${annotation.p3}"
if (annotation.p4 != prop4) return "fail 4, expected = ${prop4}, actual = ${annotation.p4}"
if (annotation.p5 != prop5) return "fail 5, expected = ${prop5}, actual = ${annotation.p5}"
if (annotation.p6 != prop6) return "fail 6, expected = ${prop6}, actual = ${annotation.p6}"
return "OK"
}