Fix test data for empty LHS vs isInitialized

Ignore the "property imported from object" part on JS
This commit is contained in:
Alexander Udalov
2017-10-25 12:10:10 +02:00
parent 42945d33ee
commit e73760d4ff
7 changed files with 49 additions and 17 deletions
@@ -2,9 +2,6 @@
package test
import kotlin.reflect.KProperty
import test.Derived.p
class Foo {
lateinit var p: String
@@ -29,12 +26,6 @@ object Bar {
}
}
open class Base(val b: Boolean)
object Derived : Base(::p.isInitialized) {
lateinit var p: String
}
fun box(): String {
val foo = Foo()
if (foo.test()) return "Fail 1"
@@ -44,7 +35,5 @@ fun box(): String {
if (bar.test()) return "Fail 3"
if (!bar.test()) return "Fail 4"
if (Derived.b) return "Fail 5"
return bar.p
}
@@ -0,0 +1,16 @@
// WITH_RUNTIME
// IGNORE_BACKEND: JS
package test
import test.Derived.p
open class Base(val b: Boolean)
object Derived : Base(::p.isInitialized) {
lateinit var p: String
}
fun box(): String {
return if (Derived.b) "Fail" else "OK"
}
@@ -13962,6 +13962,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
doTest(fileName);
}
@TestMetadata("propertyImportedFromObject.kt")
public void testPropertyImportedFromObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt");
doTest(fileName);
}
@TestMetadata("sideEffects.kt")
public void testSideEffects() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
@@ -13962,6 +13962,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
doTest(fileName);
}
@TestMetadata("propertyImportedFromObject.kt")
public void testPropertyImportedFromObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt");
doTest(fileName);
}
@TestMetadata("sideEffects.kt")
public void testSideEffects() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
@@ -13962,6 +13962,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
doTest(fileName);
}
@TestMetadata("propertyImportedFromObject.kt")
public void testPropertyImportedFromObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt");
doTest(fileName);
}
@TestMetadata("sideEffects.kt")
public void testSideEffects() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");
@@ -11735,8 +11735,7 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
}
public void testAllFilesPresentInMoveMemberToTopLevel() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/moveMemberToTopLevel"),
Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/moveMemberToTopLevel"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), TargetBackend.ANY, true);
}
@TestMetadata("function.kt")
@@ -11771,15 +11770,13 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
@TestMetadata("redeclarationConflictWithPackage.kt")
public void testRedeclarationConflictWithPackage() throws Exception {
String fileName =
KotlinTestUtils.navigationMetadata("idea/testData/intentions/moveMemberToTopLevel/redeclarationConflictWithPackage.kt");
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/moveMemberToTopLevel/redeclarationConflictWithPackage.kt");
doTest(fileName);
}
@TestMetadata("redeclarationPropertyConflict.kt")
public void testRedeclarationPropertyConflict() throws Exception {
String fileName =
KotlinTestUtils.navigationMetadata("idea/testData/intentions/moveMemberToTopLevel/redeclarationPropertyConflict.kt");
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/moveMemberToTopLevel/redeclarationPropertyConflict.kt");
doTest(fileName);
}
}
@@ -15252,6 +15252,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
doTest(fileName);
}
@TestMetadata("propertyImportedFromObject.kt")
public void testPropertyImportedFromObject() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/propertyImportedFromObject.kt");
try {
doTest(fileName);
}
catch (Throwable ignore) {
return;
}
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
}
@TestMetadata("sideEffects.kt")
public void testSideEffects() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/properties/lateinit/isInitializedAndDeinitialize/sideEffects.kt");