Minor. Update tests to support them on Android

This commit is contained in:
Mikhael Bogdanov
2020-02-27 09:30:55 +01:00
parent 8a8536f8ae
commit a9e03937a3
8 changed files with 23 additions and 16 deletions
@@ -3,7 +3,7 @@
// WITH_RUNTIME
// WITH_COROUTINES
// FULL_JDK
package test
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
@@ -3,10 +3,10 @@
// WITH_RUNTIME
// WITH_COROUTINES
// FULL_JDK
package test
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
@@ -3,10 +3,10 @@
// WITH_RUNTIME
// WITH_COROUTINES
// FULL_JDK
package test
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(EmptyContinuation)
}
@@ -1,6 +1,7 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_REFLECT
package test
import kotlin.reflect.KClass
import kotlin.test.assertEquals
@@ -16,10 +17,10 @@ fun f(): @Anno(String::class, CharSequence::class, [Double::class, Long::class,
fun box(): String {
assertEquals(
"[@Anno(k1=class java.lang.String, k2=interface java.lang.CharSequence, " +
"[@test.Anno(k1=class java.lang.String, k2=interface java.lang.CharSequence, " +
"ka=[class java.lang.Double, class java.lang.Long, class java.lang.Integer])]",
::f.returnType.annotations.toString()
)
return "OK"
}
}
@@ -1,6 +1,7 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_REFLECT
package test
import kotlin.reflect.KClass
import kotlin.test.assertEquals
@@ -66,11 +67,11 @@ fun f(): @Anno(
fun box(): String {
assertEquals(
"[@Anno(b=1, c=x, d=3.14, f=-2.72, i=42424242, j=239239239239239, s=42, z=true, " +
"[@test.Anno(b=1, c=x, d=3.14, f=-2.72, i=42424242, j=239239239239239, s=42, z=true, " +
"ba=[-1], ca=[y], da=[-3.14159], fa=[2.7218], ia=[424242], ja=[239239239239], sa=[-43], za=[false, true], " +
"str=lol, k=class java.lang.Number, k2=class [I, e=EXPRESSION, a=@Nested(value=1), stra=[lmao], " +
"str=lol, k=class java.lang.Number, k2=class [I, e=EXPRESSION, a=@test.Nested(value=1), stra=[lmao], " +
"ka=[class java.lang.Double, class kotlin.Unit, class [J, class [Ljava.lang.String;], " +
"ea=[TYPEALIAS, FIELD], aa=[@Nested(value=2), @Nested(value=3)])]",
"ea=[TYPEALIAS, FIELD], aa=[@test.Nested(value=2), @test.Nested(value=3)])]",
::f.returnType.annotations.toString()
)
@@ -4,7 +4,7 @@
// IGNORE_BACKEND: JS, NATIVE
// WITH_REFLECT
package test
import kotlin.test.assertEquals
import kotlin.test.assertNotEquals
import kotlin.test.assertTrue
@@ -58,10 +58,10 @@ fun box(): String {
val dpz = D::class.constructors.single().call(+0.0)
val fmz = F::class.constructors.single().call(-0.0f)
val fpz = F::class.constructors.single().call(+0.0f)
check(::dMinusZero.annotations.single() as D, dmz, "@D\\(d=-0.0\\)")
check(::dPlusZero.annotations.single() as D, dpz, "@D\\(d=0.0\\)")
check(::fMinusZero.annotations.single() as F, fmz, "@F\\(f=-0.0f?\\)")
check(::fPlusZero.annotations.single() as F, fpz, "@F\\(f=0.0f?\\)")
check(::dMinusZero.annotations.single() as D, dmz, "@test.D\\(d=-0.0\\)")
check(::dPlusZero.annotations.single() as D, dpz, "@test.D\\(d=0.0\\)")
check(::fMinusZero.annotations.single() as F, fmz, "@test.F\\(f=-0.0f?\\)")
check(::fPlusZero.annotations.single() as F, fpz, "@test.F\\(f=0.0f?\\)")
checkNot(dmz, dpz)
checkNot(fmz, fpz)