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.AddBracesIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.TestableReplaceBinaryInfixIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.TestableReplaceContainsIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.TestableReplaceGetIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.TestableReplaceInvokeIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.TestableReplaceUnaryPrefixIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.DoubleBangToIfThenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.ElvisToIfThenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldIfToAssignmentIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldIfToReturnIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldIfToReturnAsymmetricallyIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldWhenToAssignmentIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FoldWhenToReturnIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfThenToDoubleBangIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfThenToElvisIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfThenToSafeAccessIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IfToWhenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.WhenToIfIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.SafeAccessToIfThenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldAssignmentToIfIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldAssignmentToWhenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldPropertyToIfIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldPropertyToWhenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldReturnToIfIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.UnfoldReturnToWhenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.EliminateWhenSubjectIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.FlattenWhenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.IntroduceWhenSubjectIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.branchedTransformations.intentions.MergeWhenIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertAssertToIfWithThrowIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertIfWithThrowToAssertIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertNegatedBooleanSequenceIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertNegatedExpressionWithDemorgansLawIntention
@@ -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) {
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertToConcatenatedStringIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction
@@ -1,2 +0,0 @@
// "Convert to expression body" "true"
fun foo(): String = "abc"
@@ -1,4 +0,0 @@
// "Convert to expression body" "true"
fun foo() = bar()
fun bar() { }
@@ -1,3 +0,0 @@
// "Convert to expression body" "true"
val foo: String
get() = "abc"
@@ -1,4 +1,3 @@
// "Convert to expression body" "true"
trait I {
fun foo(): String
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: false
var a = 1
var b = 2
fun foo() {
<caret>a = b
}
@@ -1,8 +0,0 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
var a = 1
var b = 2
fun foo() {
<caret>a = b
}
@@ -1,5 +0,0 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
fun foo() {
<caret>val v = 1
}
@@ -1,3 +0,0 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
fun foo() = <caret>"abc"
@@ -1,7 +0,0 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
fun foo() {
<caret>bar()
}
fun bar(): String = "abc"
@@ -1,6 +0,0 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
fun foo(): String {
val v = 1
<caret>return "abc"
}
@@ -1,5 +0,0 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
fun foo() {
<caret>return
}
@@ -1,5 +0,0 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
fun foo(p: Boolean): String {
<caret>while(true) { }
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: false
fun foo() {
<caret>val v = 1
}
@@ -1,4 +1,4 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
// IS_APPLICABLE: false
fun foo(p: Boolean): String {
return bar() ?: return "a"
@@ -1,4 +1,4 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
// IS_APPLICABLE: false
fun foo(p: Boolean): String {
if (p) {
@@ -1,4 +1,5 @@
// "Convert to expression body" "true"
// WITH_RUNTIME
fun foo() {
<caret>throw UnsupportedOperationException()
}
@@ -1,2 +1,3 @@
// "Convert to expression body" "true"
// WITH_RUNTIME
fun foo(): Unit = throw UnsupportedOperationException()
@@ -0,0 +1,3 @@
// IS_APPLICABLE: false
fun foo() = <caret>"abc"
@@ -1,4 +1,5 @@
// "Convert to expression body" "true"
// WITH_RUNTIME
fun foo(): Nothing {
<caret>throw UnsupportedOperationException()
}
@@ -1,2 +1,3 @@
// "Convert to expression body" "true"
// WITH_RUNTIME
fun foo(): Nothing = throw UnsupportedOperationException()
@@ -1,4 +1,3 @@
// "Convert to expression body" "true"
fun <caret>foo(): String {
return "abc"
}
@@ -0,0 +1 @@
fun foo(): String = "abc"
@@ -1,4 +1,3 @@
// "Convert to expression body" "true"
fun foo() {
<caret>bar()
}
@@ -0,0 +1,3 @@
fun foo() = bar()
fun bar() { }
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun foo() {
<caret>bar()
}
fun bar(): String = "abc"
@@ -1,4 +1,5 @@
// "Convert to expression body" "true"
// WITH_RUNTIME
fun foo(): Unit {
<caret>throw UnsupportedOperationException()
}
@@ -1,2 +1,3 @@
// "Convert to expression body" "true"
// WITH_RUNTIME
fun foo(): Unit = throw UnsupportedOperationException()
@@ -1,4 +1,4 @@
// "class org.jetbrains.jet.plugin.intentions.ConvertToExpressionBodyAction" "false"
// IS_APPLICABLE: false
fun foo(handler: () -> Unit) { }
@@ -1,4 +1,3 @@
// "Convert to expression body" "true"
val foo: String
<caret>get() {
return "abc"
@@ -0,0 +1,2 @@
val foo: String
get() = "abc"
@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
fun foo(): String {
val v = 1
<caret>return "abc"
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: false
fun foo() {
<caret>return
}
@@ -0,0 +1,5 @@
// IS_APPLICABLE: false
fun foo(p: Boolean): String {
<caret>while(true) { }
}
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertToForEachFunctionCallIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertToForEachLoopIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.ConvertToStringTemplateIntention
@@ -0,0 +1 @@
org.jetbrains.jet.plugin.intentions.declarations.ConvertMemberToExtension

Some files were not shown because too many files have changed in this diff Show More