Added inline tests for jvm 8 target
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// JVM_TARGET: 1.8
|
||||
//WITH_RUNTIME
|
||||
|
||||
// FILE: 1.kt
|
||||
package test
|
||||
|
||||
public inline fun <T, R> Iterable<T>.fold2(initial: R, operation: (R, T) -> R): R {
|
||||
var accumulator = initial
|
||||
for (element in this) accumulator = operation(accumulator, element)
|
||||
return accumulator
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
import test.*
|
||||
|
||||
fun box(): String {
|
||||
val list = listOf("O", "K")
|
||||
return list.fold2("") {a, b -> a +b}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// JVM_TARGET: 1.8
|
||||
//WITH_RUNTIME
|
||||
|
||||
fun box(): String {
|
||||
val list = listOf("O", "K")
|
||||
return list.fold("") {a, b -> a +b}
|
||||
}
|
||||
|
||||
+12
@@ -203,6 +203,18 @@ public class BlackBoxWithJava8CodegenTestGenerated extends AbstractBlackBoxCodeg
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineFromAnotherFile.kt")
|
||||
public void testInlineFromAnotherFile() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/jvm8/inlineFromAnotherFile.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("inlineFromStdlib.kt")
|
||||
public void testInlineFromStdlib() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/jvm8/inlineFromStdlib.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt11969.kt")
|
||||
public void testKt11969() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/java8/box/jvm8/kt11969.kt");
|
||||
|
||||
Reference in New Issue
Block a user