Make test for replacement, which requires adding import to the package with operator, independent from stdlib.
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
// "Replace with 'newFun(n + listOf(s))'" "true"
|
||||
|
||||
import declaration.listOf
|
||||
import declaration.newFun
|
||||
import declaration.oldFun
|
||||
import weird.collections.plus
|
||||
|
||||
fun foo() {
|
||||
<caret>newFun(listOf(2) + listOf(1))
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package declaration
|
||||
|
||||
fun <T> listOf(element: T): List<T> = throw Exception()
|
||||
|
||||
@Deprecated("", ReplaceWith("newFun(n + listOf(s))", "weird.collections.plus"))
|
||||
fun oldFun(n: List<Int>, s: Int) {}
|
||||
|
||||
fun newFun(n: List<Int>) {}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
package weird.collections
|
||||
|
||||
operator fun <T> List<T>.plus(other: T): List<T> = throw Exception()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// "Replace with 'newFun(n + listOf(s))'" "true"
|
||||
|
||||
import declaration.listOf
|
||||
import declaration.oldFun
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun(listOf(2), 1)
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
// "Replace with 'newFun(n + java.math.BigInteger(s))'" "true"
|
||||
|
||||
import java.math.BigInteger
|
||||
|
||||
@Deprecated("", ReplaceWith("newFun(n + java.math.BigInteger(s))", "kotlin.math.plus"))
|
||||
fun oldFun(n: BigInteger, s: String) {}
|
||||
|
||||
fun newFun(n: BigInteger) {}
|
||||
|
||||
fun foo() {
|
||||
<caret>oldFun(BigInteger("2"), "1")
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
// "Replace with 'newFun(n + java.math.BigInteger(s))'" "true"
|
||||
|
||||
import java.math.BigInteger
|
||||
import kotlin.math.plus
|
||||
|
||||
@Deprecated("", ReplaceWith("newFun(n + java.math.BigInteger(s))", "kotlin.math.plus"))
|
||||
fun oldFun(n: BigInteger, s: String) {}
|
||||
|
||||
fun newFun(n: BigInteger) {}
|
||||
|
||||
fun foo() {
|
||||
<caret>newFun(BigInteger("2") + BigInteger("1"))
|
||||
}
|
||||
Reference in New Issue
Block a user