Moved test data into subfolders
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// "Replace with 's.newFun(this)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("s.newFun(this)"))
|
||||
fun oldFun(s: String): String = s.newFun(this)
|
||||
}
|
||||
|
||||
fun String.newFun(x: X): String = this
|
||||
|
||||
fun foo(x: X?) {
|
||||
x?.<caret>oldFun("a")
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 's.newFun(this)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("s.newFun(this)"))
|
||||
fun oldFun(s: String): String = s.newFun(this)
|
||||
}
|
||||
|
||||
fun String.newFun(x: X): String = this
|
||||
|
||||
fun foo(x: X?) {
|
||||
<caret>if (x != null) {
|
||||
"a".newFun(x)
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with 'c.newFun(this)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("c.newFun(this)"))
|
||||
fun oldFun(c: Char): Char = c.newFun(this)
|
||||
}
|
||||
|
||||
fun Char.newFun(x: X): Char = this
|
||||
|
||||
fun foo(x: X?, p: Boolean, s: String) {
|
||||
val chars = s.filter {
|
||||
val v = if (p)
|
||||
x?.<caret>oldFun(it)
|
||||
else
|
||||
null
|
||||
v != 'a'
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with 'c.newFun(this)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("c.newFun(this)"))
|
||||
fun oldFun(c: Char): Char = c.newFun(this)
|
||||
}
|
||||
|
||||
fun Char.newFun(x: X): Char = this
|
||||
|
||||
fun foo(x: X?, p: Boolean, s: String) {
|
||||
val chars = s.filter {
|
||||
val v = if (p)
|
||||
x?.let { x -> it.newFun(x) }
|
||||
else
|
||||
null
|
||||
v != 'a'
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with 's.filter { it != c }'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("s.filter { it != c }"))
|
||||
fun oldFun(s: String): CharSequence = s.filter { it != c }
|
||||
|
||||
val c = 'x'
|
||||
}
|
||||
|
||||
fun foo(x: X?, s: String) {
|
||||
bar(x?.<caret>oldFun(s))
|
||||
}
|
||||
|
||||
fun bar(s: CharSequence?){}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// "Replace with 's.filter { it != c }'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("s.filter { it != c }"))
|
||||
fun oldFun(s: String): CharSequence = s.filter { it != c }
|
||||
|
||||
val c = 'x'
|
||||
}
|
||||
|
||||
fun foo(x: X?, s: String) {
|
||||
bar(x?.<caret>let { x -> s.filter { it != x.c } })
|
||||
}
|
||||
|
||||
fun bar(s: CharSequence?){}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Replace with 'c1.newFun(this, c2)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("c1.newFun(this, c2)"))
|
||||
fun oldFun(c1: Char, c2: Char): Char = c1.newFun(this, c2)
|
||||
|
||||
val c: Char = 'a'
|
||||
}
|
||||
|
||||
fun Char.newFun(x: X, c: Char): Char = this
|
||||
|
||||
fun foo(s: String, x: X) {
|
||||
val chars = s.filter {
|
||||
O.x?.<caret>oldFun(it, x.c) != 'a'
|
||||
}
|
||||
}
|
||||
|
||||
object O {
|
||||
var x: X? = null
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// "Replace with 'c1.newFun(this, c2)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("c1.newFun(this, c2)"))
|
||||
fun oldFun(c1: Char, c2: Char): Char = c1.newFun(this, c2)
|
||||
|
||||
val c: Char = 'a'
|
||||
}
|
||||
|
||||
fun Char.newFun(x: X, c: Char): Char = this
|
||||
|
||||
fun foo(s: String, x: X) {
|
||||
val chars = s.filter {
|
||||
O.x?.<caret>let { x1 -> it.newFun(x1, x.c) } != 'a'
|
||||
}
|
||||
}
|
||||
|
||||
object O {
|
||||
var x: X? = null
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'c1.newFun(this, c2)'" "true"
|
||||
|
||||
class X(val c: Char) {
|
||||
@deprecated("", ReplaceWith("c1.newFun(this, c2)"))
|
||||
fun oldFun(c1: Char, c2: Char): Char = c1.newFun(this, c2)
|
||||
}
|
||||
|
||||
fun Char.newFun(x: X, c: Char): Char = this
|
||||
|
||||
fun foo(s: String, t: X) {
|
||||
val chars = s.filter {
|
||||
(X('a') + X('b'))?.<caret>oldFun(it, t.c) != 'a'
|
||||
}
|
||||
}
|
||||
|
||||
fun X.plus(x: X): X? = null
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// "Replace with 'c1.newFun(this, c2)'" "true"
|
||||
|
||||
class X(val c: Char) {
|
||||
@deprecated("", ReplaceWith("c1.newFun(this, c2)"))
|
||||
fun oldFun(c1: Char, c2: Char): Char = c1.newFun(this, c2)
|
||||
}
|
||||
|
||||
fun Char.newFun(x: X, c: Char): Char = this
|
||||
|
||||
fun foo(s: String, t: X) {
|
||||
val chars = s.filter {
|
||||
(X('a') + X('b'))?.let { t1 -> it.newFun(t1, t.c) } != 'a'
|
||||
}
|
||||
}
|
||||
|
||||
fun X.plus(x: X): X? = null
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 's.newFun(this)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("s.newFun(this)"))
|
||||
fun oldFun(s: String): String = s.newFun(this)
|
||||
}
|
||||
|
||||
fun String.newFun(x: X): String = this
|
||||
|
||||
fun foo(x: X?, p: Boolean) {
|
||||
val v = if (p)
|
||||
x?.<caret>oldFun("a")
|
||||
else
|
||||
null
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with 's.newFun(this)'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("s.newFun(this)"))
|
||||
fun oldFun(s: String): String = s.newFun(this)
|
||||
}
|
||||
|
||||
fun String.newFun(x: X): String = this
|
||||
|
||||
fun foo(x: X?, p: Boolean) {
|
||||
val v = if (p)
|
||||
x?.<caret>let { "a".newFun(it) }
|
||||
else
|
||||
null
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(){}
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo(x: X) {
|
||||
x?.<caret>oldFun()
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(){}
|
||||
}
|
||||
|
||||
fun newFun(){}
|
||||
|
||||
fun foo(x: X) {
|
||||
<caret>if (x != null) {
|
||||
newFun()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(){}
|
||||
|
||||
fun newFun(){}
|
||||
}
|
||||
|
||||
fun foo(x: X?) {
|
||||
x?.<caret>oldFun()
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'newFun()'" "true"
|
||||
|
||||
class X {
|
||||
@deprecated("", ReplaceWith("newFun()"))
|
||||
fun oldFun(){}
|
||||
|
||||
fun newFun(){}
|
||||
}
|
||||
|
||||
fun foo(x: X?) {
|
||||
x?.<caret>newFun()
|
||||
}
|
||||
Reference in New Issue
Block a user