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:
Evgeny Gerashchenko
2014-07-07 21:09:31 +04:00
parent b1003fc034
commit fda7aeecfb
169 changed files with 4764 additions and 4969 deletions
@@ -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,4 +1,3 @@
// "Convert to block body" "true"
fun foo(): String {
return "abc"
}
@@ -1,3 +1,2 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: bar
fun <caret>foo(): String = bar()
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: bar
fun <caret>foo(): String {
return bar()
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: XXX
// ERROR: Unresolved reference: bar
fun <caret>foo(): XXX = bar()
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: XXX
// ERROR: Unresolved reference: bar
fun <caret>foo(): XXX {
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
fun <caret>foo(): Unit = bar()
fun bar() { }
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
fun foo(): Unit {
bar()
}
@@ -1,3 +1,2 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: bar
fun <caret>foo(): Unit = bar()
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
// ERROR: Unresolved reference: bar
fun <caret>foo(): Unit {
bar()
@@ -1,2 +1,3 @@
// "Convert to block body" "true"
// WITH_RUNTIME
fun <caret>foo(): String = throw UnsupportedOperationException()
@@ -1,4 +1,5 @@
// "Convert to block body" "true"
// WITH_RUNTIME
fun <caret>foo(): String {
throw UnsupportedOperationException()
}
@@ -1,3 +1,2 @@
// "Convert to block body" "true"
val foo: String
<caret>get() = "abc"
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
val foo: String
get() {
return "abc"
@@ -1,3 +1,4 @@
// "Convert to block body" "true"
// WITH_RUNTIME
val foo: String
<caret>get() = throw UnsupportedOperationException()
@@ -1,4 +1,5 @@
// "Convert to block body" "true"
// WITH_RUNTIME
val foo: String
get() {
throw UnsupportedOperationException()
@@ -1,2 +1,3 @@
// "Convert to block body" "true"
// WITH_RUNTIME
fun <caret>foo() = java.io.File("x").toURI()
@@ -1,4 +1,5 @@
// "Convert to block body" "true"
// WITH_RUNTIME
import java.net.URI
fun foo(): URI {
@@ -1,3 +1,3 @@
// "Convert to block body" "false"
// IS_APPLICABLE: false
// ERROR: Unresolved reference: bar
fun <caret>foo() = bar()
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
fun <caret>foo() = bar()
fun bar() { }
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
fun foo() {
bar()
}
@@ -1,2 +1,3 @@
// "Convert to block body" "true"
// WITH_RUNTIME
fun <caret>foo(): Nothing = throw UnsupportedOperationException()
@@ -1,4 +1,5 @@
// "Convert to block body" "true"
// WITH_RUNTIME
fun foo(): Nothing {
throw UnsupportedOperationException()
}
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
var foo: String
get() = "abc"
<caret>set(value) = doSet(value)
@@ -1,4 +1,3 @@
// "Convert to block body" "true"
var foo: String
get() = "abc"
set(value) {