Do not use reflection it local/top-level lateinit tests

This commit is contained in:
Dmitry Petrov
2017-08-30 14:12:31 +03:00
parent 638eb28692
commit c8d25c587a
9 changed files with 59 additions and 14 deletions
@@ -1,5 +1,5 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// WITH_RUNTIME
// IGNORE_BACKEND: JS, NATIVE
import kotlin.UninitializedPropertyAccessException
@@ -19,6 +19,6 @@ fun box(): String {
return "OK"
}
catch (e: Throwable) {
return "Unexpected exception: ${e::class.qualifiedName}"
return "Unexpected exception: ${e::class}"
}
}
@@ -1,5 +1,5 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// WITH_RUNTIME
// IGNORE_BACKEND: JS, NATIVE
import kotlin.UninitializedPropertyAccessException
@@ -19,6 +19,6 @@ fun box(): String {
return "OK"
}
catch (e: Throwable) {
return "Unexpected exception: ${e::class.qualifiedName}"
return "Unexpected exception: ${e::class}"
}
}
@@ -1,5 +1,5 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// WITH_RUNTIME
// IGNORE_BACKEND: JS, NATIVE
import kotlin.UninitializedPropertyAccessException
@@ -15,6 +15,6 @@ fun box(): String {
return "OK"
}
catch (e: Throwable) {
return "Unexpected exception: ${e::class.qualifiedName}"
return "Unexpected exception: ${e::class}"
}
}
@@ -1,5 +1,5 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// WITH_RUNTIME
// IGNORE_BACKEND: JS, NATIVE
import kotlin.UninitializedPropertyAccessException
@@ -15,6 +15,6 @@ fun box(): String {
return "OK"
}
catch (e: Throwable) {
return "Unexpected exception: ${e::class.qualifiedName}"
return "Unexpected exception: ${e::class}"
}
}
@@ -1,5 +1,5 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// WITH_RUNTIME
// IGNORE_BACKEND: JS, NATIVE
// FILE: lateinit.kt
private lateinit var s: String
@@ -22,7 +22,7 @@ fun box(): String {
return "OK"
}
catch (e: Throwable) {
return "Unexpected exception: ${e::class.qualifiedName}"
return "Unexpected exception: ${e::class}"
}
}
@@ -1,5 +1,5 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// WITH_RUNTIME
// IGNORE_BACKEND: JS, NATIVE
import kotlin.UninitializedPropertyAccessException
@@ -16,6 +16,6 @@ fun box(): String {
return "OK"
}
catch (e: Throwable) {
return "Unexpected exception: ${e::class.qualifiedName}"
return "Unexpected exception: ${e::class}"
}
}
@@ -1,5 +1,5 @@
// LANGUAGE_VERSION: 1.2
// WITH_REFLECT
// WITH_RUNTIME
// IGNORE_BACKEND: JS, NATIVE
import kotlin.UninitializedPropertyAccessException
@@ -16,6 +16,6 @@ fun box(): String {
return "OK"
}
catch (e: Throwable) {
return "Unexpected exception: ${e::class.qualifiedName}"
return "Unexpected exception: ${e::class}"
}
}
@@ -84,6 +84,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
doTest(fileName);
}
@TestMetadata("hugeUnresolvedKotlinxHtml.kt")
public void testHugeUnresolvedKotlinxHtml() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/hugeUnresolvedKotlinxHtml.kt");
doTest(fileName);
}
@TestMetadata("ifElseJavaList.kt")
public void testIfElseJavaList() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/ifElseJavaList.kt");
@@ -13053,6 +13053,33 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/lateinit/setter.kt");
doTest(fileName);
}
@TestMetadata("compiler/testData/diagnostics/tests/lateinit/local")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class Local extends AbstractDiagnosticsUsingJavacTest {
public void testAllFilesPresentInLocal() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/lateinit/local"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("inapplicableLateinitModifier.kt")
public void testInapplicableLateinitModifier() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/lateinit/local/inapplicableLateinitModifier.kt");
doTest(fileName);
}
@TestMetadata("localLateinit.kt")
public void testLocalLateinit() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/lateinit/local/localLateinit.kt");
doTest(fileName);
}
@TestMetadata("uninitialized.kt")
public void testUninitialized() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/lateinit/local/uninitialized.kt");
doTest(fileName);
}
}
}
@TestMetadata("compiler/testData/diagnostics/tests/library")
@@ -16174,6 +16201,12 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
doTest(fileName);
}
@TestMetadata("lateinitOnTopLevel.kt")
public void testLateinitOnTopLevel() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/properties/lateinitOnTopLevel.kt");
doTest(fileName);
}
@TestMetadata("compiler/testData/diagnostics/tests/properties/inferenceFromGetters")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -18129,6 +18162,12 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
doTest(fileName);
}
@TestMetadata("manyInapplicableCandidatesWithLambdas.kt")
public void testManyInapplicableCandidatesWithLambdas() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.kt");
doTest(fileName);
}
@TestMetadata("twoTypeParameters.kt")
public void testTwoTypeParameters() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/resolve/nestedCalls/twoTypeParameters.kt");