diff --git a/idea/testData/inspections/cleanup/cleanup.kt b/idea/testData/inspections/cleanup/cleanup.kt index 57beeaf9e8a..d59bd1fb92f 100644 --- a/idea/testData/inspections/cleanup/cleanup.kt +++ b/idea/testData/inspections/cleanup/cleanup.kt @@ -22,6 +22,11 @@ fun foo() { oldFun1(oldFun2(10)) oldFun2() + + ff() + val xx = valX + varX = 50 + varY = 60 } fun unnecessarySafeCall(x: String) { diff --git a/idea/testData/inspections/cleanup/cleanup.kt.after b/idea/testData/inspections/cleanup/cleanup.kt.after index 85d0619e0da..dc24beaa44f 100644 --- a/idea/testData/inspections/cleanup/cleanup.kt.after +++ b/idea/testData/inspections/cleanup/cleanup.kt.after @@ -21,6 +21,11 @@ fun foo() { bar(bar(10 + 2) + 1) oldFun2() + + ff() + val xx = valX + varX = 50 + varY = 60 } fun unnecessarySafeCall(x: String) { diff --git a/idea/testData/inspections/cleanup/topLevels.kt b/idea/testData/inspections/cleanup/topLevels.kt new file mode 100644 index 00000000000..0844dabbb73 --- /dev/null +++ b/idea/testData/inspections/cleanup/topLevels.kt @@ -0,0 +1,8 @@ +private fun ff() {} + +private val valX = 10 + +private var varX = 20 + +var varY = 30 + private set(value: Int) {} \ No newline at end of file diff --git a/idea/testData/inspections/cleanup/topLevels.kt.after b/idea/testData/inspections/cleanup/topLevels.kt.after new file mode 100644 index 00000000000..6225521892b --- /dev/null +++ b/idea/testData/inspections/cleanup/topLevels.kt.after @@ -0,0 +1,8 @@ +internal fun ff() {} + +internal val valX = 10 + +internal var varX = 20 + +var varY = 30 + internal set(value: Int) {} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspectionTest.kt b/idea/tests/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspectionTest.kt index 9c023503190..7df46da420a 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspectionTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/inspections/KotlinCleanupInspectionTest.kt @@ -43,9 +43,10 @@ class KotlinCleanupInspectionTest(): JetLightCodeInsightFixtureTestCase() { globalContext.codeCleanup(project, analysisScope, profile, "Cleanup", null, true) myFixture.checkResultByFile(result) + myFixture.checkResultByFile("topLevels.kt", "topLevels.kt.after", true) } public fun testCleanup() { - doTest("cleanup.kt.after", "cleanup.kt", "JavaAnn.java", "deprecatedSymbols.kt") + doTest("cleanup.kt.after", "cleanup.kt", "topLevels.kt","JavaAnn.java", "deprecatedSymbols.kt") } }