Simplified CodeTransformationTest. Only one doTest method remains, intention class is moved to test data. Merged other intention tests (SpecifyTypeExplicitlyTest, ConvertToBlock/ExpressionBodyTest) into this one.
This commit is contained in:
@@ -0,0 +1 @@
|
||||
org.jetbrains.jet.plugin.intentions.ConvertToBlockBodyAction
|
||||
@@ -1,2 +0,0 @@
|
||||
// "Convert to block body" "true"
|
||||
fun <caret>foo(): String = "abc"
|
||||
@@ -0,0 +1 @@
|
||||
fun <caret>foo(): String = "abc"
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
fun foo(): String {
|
||||
return "abc"
|
||||
}
|
||||
-1
@@ -1,3 +1,2 @@
|
||||
// "Convert to block body" "true"
|
||||
// ERROR: Unresolved reference: bar
|
||||
fun <caret>foo(): String = bar()
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
// ERROR: Unresolved reference: bar
|
||||
fun <caret>foo(): String {
|
||||
return bar()
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
// ERROR: Unresolved reference: XXX
|
||||
// ERROR: Unresolved reference: bar
|
||||
fun <caret>foo(): XXX = bar()
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
// ERROR: Unresolved reference: XXX
|
||||
// ERROR: Unresolved reference: bar
|
||||
fun <caret>foo(): XXX {
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
fun <caret>foo(): Unit = bar()
|
||||
|
||||
fun bar() { }
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
fun foo(): Unit {
|
||||
bar()
|
||||
}
|
||||
-1
@@ -1,3 +1,2 @@
|
||||
// "Convert to block body" "true"
|
||||
// ERROR: Unresolved reference: bar
|
||||
fun <caret>foo(): Unit = bar()
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
// ERROR: Unresolved reference: bar
|
||||
fun <caret>foo(): Unit {
|
||||
bar()
|
||||
+2
-1
@@ -1,2 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun <caret>foo(): String = throw UnsupportedOperationException()
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
// "Convert to block body" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun <caret>foo(): String {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
-1
@@ -1,3 +1,2 @@
|
||||
// "Convert to block body" "true"
|
||||
val foo: String
|
||||
<caret>get() = "abc"
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
val foo: String
|
||||
get() {
|
||||
return "abc"
|
||||
+2
-1
@@ -1,3 +1,4 @@
|
||||
// "Convert to block body" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
val foo: String
|
||||
<caret>get() = throw UnsupportedOperationException()
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
// "Convert to block body" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
val foo: String
|
||||
get() {
|
||||
throw UnsupportedOperationException()
|
||||
+2
-1
@@ -1,2 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun <caret>foo() = java.io.File("x").toURI()
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
// "Convert to block body" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
import java.net.URI
|
||||
|
||||
fun foo(): URI {
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// "Convert to block body" "false"
|
||||
// IS_APPLICABLE: false
|
||||
// ERROR: Unresolved reference: bar
|
||||
fun <caret>foo() = bar()
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
fun <caret>foo() = bar()
|
||||
|
||||
fun bar() { }
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
fun foo() {
|
||||
bar()
|
||||
}
|
||||
+2
-1
@@ -1,2 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun <caret>foo(): Nothing = throw UnsupportedOperationException()
|
||||
+2
-1
@@ -1,4 +1,5 @@
|
||||
// "Convert to block body" "true"
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo(): Nothing {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
var foo: String
|
||||
get() = "abc"
|
||||
<caret>set(value) = doSet(value)
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// "Convert to block body" "true"
|
||||
var foo: String
|
||||
get() = "abc"
|
||||
set(value) {
|
||||
Reference in New Issue
Block a user