extend test for code cleanup with changing visibility from private to internal for declarations, which are used outside of their file.
This commit is contained in:
@@ -22,6 +22,11 @@ fun foo() {
|
|||||||
oldFun1(oldFun2(10))
|
oldFun1(oldFun2(10))
|
||||||
|
|
||||||
oldFun2()
|
oldFun2()
|
||||||
|
|
||||||
|
ff()
|
||||||
|
val xx = valX
|
||||||
|
varX = 50
|
||||||
|
varY = 60
|
||||||
}
|
}
|
||||||
|
|
||||||
fun unnecessarySafeCall(x: String) {
|
fun unnecessarySafeCall(x: String) {
|
||||||
|
|||||||
@@ -21,6 +21,11 @@ fun foo() {
|
|||||||
bar(bar(10 + 2) + 1)
|
bar(bar(10 + 2) + 1)
|
||||||
|
|
||||||
oldFun2()
|
oldFun2()
|
||||||
|
|
||||||
|
ff()
|
||||||
|
val xx = valX
|
||||||
|
varX = 50
|
||||||
|
varY = 60
|
||||||
}
|
}
|
||||||
|
|
||||||
fun unnecessarySafeCall(x: String) {
|
fun unnecessarySafeCall(x: String) {
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
private fun ff() {}
|
||||||
|
|
||||||
|
private val valX = 10
|
||||||
|
|
||||||
|
private var varX = 20
|
||||||
|
|
||||||
|
var varY = 30
|
||||||
|
private set(value: Int) {}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
internal fun ff() {}
|
||||||
|
|
||||||
|
internal val valX = 10
|
||||||
|
|
||||||
|
internal var varX = 20
|
||||||
|
|
||||||
|
var varY = 30
|
||||||
|
internal set(value: Int) {}
|
||||||
@@ -43,9 +43,10 @@ class KotlinCleanupInspectionTest(): JetLightCodeInsightFixtureTestCase() {
|
|||||||
globalContext.codeCleanup(project, analysisScope, profile, "Cleanup", null, true)
|
globalContext.codeCleanup(project, analysisScope, profile, "Cleanup", null, true)
|
||||||
|
|
||||||
myFixture.checkResultByFile(result)
|
myFixture.checkResultByFile(result)
|
||||||
|
myFixture.checkResultByFile("topLevels.kt", "topLevels.kt.after", true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun testCleanup() {
|
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")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user