Don't test parent structure consistency in irrelevant cases
This commit is contained in:
@@ -21,8 +21,20 @@ abstract class AbstractKotlinRenderLogTest : AbstractKotlinUastTest(), RenderLog
|
|||||||
File(File(TEST_KOTLIN_MODEL_DIR, testName).canonicalPath + '.' + ext)
|
File(File(TEST_KOTLIN_MODEL_DIR, testName).canonicalPath + '.' + ext)
|
||||||
|
|
||||||
override fun check(testName: String, file: UFile) {
|
override fun check(testName: String, file: UFile) {
|
||||||
|
check(testName, file, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun check(testName: String, file: UFile, checkParentConsistency: Boolean) {
|
||||||
super.check(testName, file)
|
super.check(testName, file)
|
||||||
|
|
||||||
|
if (checkParentConsistency) {
|
||||||
|
checkParentConsistency(file)
|
||||||
|
}
|
||||||
|
|
||||||
|
file.checkContainingFileForAllElements()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun checkParentConsistency(file: UFile) {
|
||||||
val parentMap = mutableMapOf<PsiElement, String>()
|
val parentMap = mutableMapOf<PsiElement, String>()
|
||||||
|
|
||||||
file.accept(object : UastVisitor {
|
file.accept(object : UastVisitor {
|
||||||
@@ -65,8 +77,6 @@ abstract class AbstractKotlinRenderLogTest : AbstractKotlinUastTest(), RenderLog
|
|||||||
super.visitElement(element)
|
super.visitElement(element)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
file.checkContainingFileForAllElements()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun UFile.checkContainingFileForAllElements() {
|
private fun UFile.checkContainingFileForAllElements() {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class SimpleKotlinRenderLogTest : AbstractKotlinRenderLogTest() {
|
|||||||
|
|
||||||
@Test fun testQualifiedConstructorCall() = doTest("QualifiedConstructorCall")
|
@Test fun testQualifiedConstructorCall() = doTest("QualifiedConstructorCall")
|
||||||
|
|
||||||
@Test fun testPropertyDelegate() = doTest("PropertyDelegate")
|
@Test fun testPropertyDelegate() = doTest("PropertyDelegate") { testName, file -> check(testName, file, false) }
|
||||||
|
|
||||||
@Test fun testPropertyWithAnnotation() = doTest("PropertyWithAnnotation")
|
@Test fun testPropertyWithAnnotation() = doTest("PropertyWithAnnotation")
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@ class SimpleKotlinRenderLogTest : AbstractKotlinRenderLogTest() {
|
|||||||
|
|
||||||
@Test fun testInnerClasses() = doTest("InnerClasses")
|
@Test fun testInnerClasses() = doTest("InnerClasses")
|
||||||
|
|
||||||
@Test fun testSimpleScript() = doTest("SimpleScript")
|
@Test fun testSimpleScript() = doTest("SimpleScript") { testName, file -> check(testName, file, false) }
|
||||||
|
|
||||||
@Test fun testDestructuringDeclaration() = doTest("DestructuringDeclaration")
|
@Test fun testDestructuringDeclaration() = doTest("DestructuringDeclaration")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user