Added more quickfixes; added tests

This commit is contained in:
svtk
2011-09-21 17:58:44 +04:00
parent e6c871aecc
commit 7f815176f6
96 changed files with 1357 additions and 147 deletions
@@ -0,0 +1,4 @@
// "Replace to dot call" "true"
fun foo(a: Any) {
<caret>a.equals(0)
}
@@ -0,0 +1,7 @@
// "Replace to dot call" "true"
fun foo(a: Any) {
when (a) {
.equals(0) => true
else => false
}
}
@@ -0,0 +1,4 @@
// "Replace a cast with a static assert" "true"
fun foo(a: String) {
val b = a : Any
}
@@ -0,0 +1,4 @@
// "Remove cast" "true"
fun foo(a: Any) {
val b = a<caret>
}
@@ -0,0 +1,4 @@
// "Remove elvis operator" "true"
fun foo(a: String) {
val b : String = <caret>a
}
@@ -0,0 +1,4 @@
// "Replace to dot call" "true"
fun foo(a: Any) {
a<caret>?.equals(0)
}
@@ -0,0 +1,7 @@
// "Replace to dot call" "true"
fun foo(a: Any) {
when (a) {
<caret>?.equals(0) => true
else => false
}
}
@@ -0,0 +1,4 @@
// "Replace a cast with a static assert" "true"
fun foo(a: String) {
val b = a <caret>as Any
}
@@ -0,0 +1,4 @@
// "Remove cast" "true"
fun foo(a: Any) {
val b = a <caret>as Any
}
@@ -0,0 +1,4 @@
// "Remove elvis operator" "true"
fun foo(a: String) {
val b : String = <caret>a ?: "s"
}