Add test for kotlin.streams function usage in Kotlin code
NB: does not pass in javac mode due to lack of JvmPackageName support
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
// FULL_JDK
|
||||
// STDLIB_JDK8
|
||||
|
||||
import java.util.*
|
||||
import kotlin.streams.toList
|
||||
|
||||
fun testStreams(list: ArrayList<String>) {
|
||||
list.stream().toList()
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package
|
||||
|
||||
public fun testStreams(/*0*/ list: java.util.ArrayList<kotlin.String>): kotlin.Unit
|
||||
+5
-4
@@ -104,13 +104,14 @@ public abstract class KotlinMultiFileTestWithJava<M, F> extends KtUsefulTestCase
|
||||
result.add(KotlinTestUtils.getAnnotationsJar());
|
||||
result.addAll(getExtraClasspath());
|
||||
|
||||
boolean loadAndroidAnnotations = InTextDirectivesUtils.isDirectiveDefined(
|
||||
FilesKt.readText(file, Charsets.UTF_8), "ANDROID_ANNOTATIONS"
|
||||
);
|
||||
String fileText = FilesKt.readText(file, Charsets.UTF_8);
|
||||
|
||||
if (loadAndroidAnnotations) {
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(fileText, "ANDROID_ANNOTATIONS")) {
|
||||
result.add(ForTestCompileRuntime.androidAnnotationsForTests());
|
||||
}
|
||||
if (InTextDirectivesUtils.isDirectiveDefined(fileText, "STDLIB_JDK8")) {
|
||||
result.add(ForTestCompileRuntime.runtimeJarForTestsWithJdk8());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+5
@@ -25,6 +25,11 @@ public class ForTestCompileRuntime {
|
||||
return assertExists(new File("dist/kotlinc/lib/kotlin-stdlib.jar"));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static File runtimeJarForTestsWithJdk8() {
|
||||
return assertExists(new File("dist/kotlinc/lib/kotlin-stdlib-jdk8.jar"));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static File minimalRuntimeJarForTests() {
|
||||
return assertExists(new File("dist/kotlin-stdlib-minimal-for-test.jar"));
|
||||
|
||||
+5
@@ -154,6 +154,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("streams.kt")
|
||||
public void testStreams() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/streams.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+5
@@ -154,6 +154,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/shadowingInDestructuring.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("streams.kt")
|
||||
public void testStreams() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/streams.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user