Quickfix and intention tests refactoring: refer to intention action by class when checking that it's not available (instead of listing all available actions)

This commit is contained in:
Valentin Kipyatkov
2014-01-23 17:00:26 +04:00
parent 3028cec4cd
commit d01ff28212
75 changed files with 99 additions and 136 deletions
@@ -1,8 +1,5 @@
// "Make Object.notify open" "false"
// "class org.jetbrains.jet.plugin.quickfix.MakeOverriddenMemberOpenFix" "false"
// ERROR: 'notify' in 'Object' is final and cannot be overridden
// ACTION: Convert to extension
// ACTION: Disable 'Convert to extension'
// ACTION: Edit intention settings
class A : Object() {
override<caret> fun notify() {}
}
@@ -1,10 +1,7 @@
// "Make 'ordinal' in E and X open" "false"
// "class org.jetbrains.jet.plugin.quickfix.MakeOverriddenMemberOpenFix" "false"
// ERROR: This type is final, so it cannot be inherited from
// ERROR: Cannot access '<init>': it is 'private' in 'E'
// ERROR: 'ordinal' in 'E' is final and cannot be overridden
// ACTION: Convert to extension
// ACTION: Disable 'Convert to extension'
// ACTION: Edit intention settings
enum class E {}
trait X {
final fun ordinal() : Int = 42
@@ -1,4 +1,5 @@
// "Rename parameter to match overridden method" "false"
// "class org.jetbrains.jet.plugin.quickfix.RenameParameterToMatchOverriddenMethodFix" "false"
abstract class A {
abstract fun foo(arg : Int) : Int;
}
@@ -1,10 +1,5 @@
// "Change function signature to 'override fun f(a: Int)'" "false"
// "class org.jetbrains.jet.plugin.quickfix.ChangeMemberFunctionSignatureFix" "false"
// ERROR: 'f' overrides nothing
// ACTION: Add 'open fun f(a: String)' to 'A'
// ACTION: Remove 'override' modifier
// ACTION: Convert to extension
// ACTION: Disable 'Convert to extension'
// ACTION: Edit intention settings
open class A {
open fun foo() {}
fun f(a: Int) {}
@@ -1,4 +1,4 @@
// "Change 'A.x' type to 'String'" "false"
// "class org.jetbrains.jet.plugin.quickfix.ChangeVariableTypeFix" "false"
// ERROR: <html>Var-property type is 'jet.String', which is not a type of overridden<br/><b>internal</b> <b>abstract</b> <b>var</b> x: jet.Int <i>defined in</i> A</html>
trait A {
var x: Int
@@ -1,4 +1,4 @@
// "Change 'C.x' type to 'String'" "false"
// "class org.jetbrains.jet.plugin.quickfix.ChangeVariableTypeFix" "false"
// ERROR: <html>Var-property type is 'jet.Int', which is not a type of overridden<br/><b>internal</b> <b>abstract</b> <b>var</b> x: jet.String <i>defined in</i> A</html>
trait A {
var x: String
@@ -1,4 +1,4 @@
// "Change 'A.foo' function return type to 'Long'" "false"
// "class org.jetbrains.jet.plugin.quickfix.ChangeFunctionReturnTypeFix" "false"
// ERROR: <html>Return type is 'jet.Long', which is not a subtype of overridden<br/><b>internal</b> <b>abstract</b> <b>fun</b> foo(): jet.Int <i>defined in</i> A</html>
trait A {
fun foo(): Int