From 76256729144877f7dbac14172eb199d63d536c8e Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Tue, 20 Sep 2016 19:15:18 +0300 Subject: [PATCH] Better test data --- .../cast/changeFunctionalToStarProjection.kt | 2 +- .../cast/uncheckedCastOnTypeParameter.kt | 2 +- .../noDefaultValue.kt | 2 +- .../quickfix/autoImports/delegateNoOperator.test | 2 +- .../falsePostfixOperator.before.Main.kt | 2 +- .../indexCallExtensionGetNoOperator.test | 2 +- ...CallNoImportWhenGetNeededButSetAvailable.test | 2 +- ...CallNoImportWhenSetNeededButGetAvailable.test | 2 +- .../autoImports/infixCall2.before.Main.kt | 2 +- .../autoImports/invokeExtensionNoOperator.test | 2 +- ...iDeclarationExtensionComponentNoOperator.test | 2 +- ...xNullableWithExclExclAbsentWithBadIterator.kt | 2 +- .../quickfix/foldTryCatch/conditional.kt | 2 +- idea/testData/quickfix/foldTryCatch/shadow.kt | 2 +- .../quickfix/implement/incorrectRange.kt | 2 +- idea/testData/quickfix/implement/local.kt | 2 +- .../quickfix/implement/noDefaultConstructor.kt | 2 +- .../quickfix/implement/privateConstructor.kt | 2 +- .../nonApplicableWithOneConstructor.kt | 2 +- .../primaryRequiredNoSuper.kt | 2 +- .../leakingThis/accessOverriddenProperty.kt | 2 +- idea/testData/quickfix/leakingThis/inAbstract.kt | 2 +- .../quickfix/leakingThis/inOverridden.kt | 2 +- .../makeConstructorParameterProperty/override.kt | 2 +- ...ddArrayOfTypeForJavaAnnotation.before.Main.kt | 2 +- ...oRemoveNullabilityDisabledWhenItCannotHelp.kt | 2 +- .../quickfix/when/twoElseBranchesInWhen.kt.after | 16 ---------------- 27 files changed, 26 insertions(+), 42 deletions(-) delete mode 100644 idea/testData/quickfix/when/twoElseBranchesInWhen.kt.after diff --git a/idea/testData/quickfix/addStarProjections/cast/changeFunctionalToStarProjection.kt b/idea/testData/quickfix/addStarProjections/cast/changeFunctionalToStarProjection.kt index 22157c89107..c10527f45dd 100644 --- a/idea/testData/quickfix/addStarProjections/cast/changeFunctionalToStarProjection.kt +++ b/idea/testData/quickfix/addStarProjections/cast/changeFunctionalToStarProjection.kt @@ -1,4 +1,4 @@ -// "Change type arguments to <*, *>" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ChangeToStarProjectionFix" "false" // ACTION: Convert to expression body class Constructor(val x: T) diff --git a/idea/testData/quickfix/addStarProjections/cast/uncheckedCastOnTypeParameter.kt b/idea/testData/quickfix/addStarProjections/cast/uncheckedCastOnTypeParameter.kt index 9b897c34b44..b3fc00c2d90 100644 --- a/idea/testData/quickfix/addStarProjections/cast/uncheckedCastOnTypeParameter.kt +++ b/idea/testData/quickfix/addStarProjections/cast/uncheckedCastOnTypeParameter.kt @@ -1,4 +1,4 @@ -// "Change type arguments to <>" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ChangeToStarProjectionFix" "false" // ACTION: Convert to expression body fun get(column: String, map: Map): T { return map[column] as T diff --git a/idea/testData/quickfix/addTypeAnnotationToValueParameter/noDefaultValue.kt b/idea/testData/quickfix/addTypeAnnotationToValueParameter/noDefaultValue.kt index 3bd297d4c2e..b62e12fe2bc 100644 --- a/idea/testData/quickfix/addTypeAnnotationToValueParameter/noDefaultValue.kt +++ b/idea/testData/quickfix/addTypeAnnotationToValueParameter/noDefaultValue.kt @@ -1,4 +1,4 @@ -// "Add type 'Int' to parameter 'bar'" "false" +// "class org.jetbrains.kotlin.idea.quickfix.AddTypeAnnotationToValueParameterFix" "false" // ERROR: A type annotation is required on a value parameter // ACTION: Create test diff --git a/idea/testData/quickfix/autoImports/delegateNoOperator.test b/idea/testData/quickfix/autoImports/delegateNoOperator.test index 6fc3097634e..180acc4ccec 100644 --- a/idea/testData/quickfix/autoImports/delegateNoOperator.test +++ b/idea/testData/quickfix/autoImports/delegateNoOperator.test @@ -1,5 +1,5 @@ // FILE: first.before.kt -// "Import" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Missing 'getValue(Nothing?, KProperty<*>)' method on delegate of type 'String' // ACTION: To raw string literal diff --git a/idea/testData/quickfix/autoImports/falsePostfixOperator.before.Main.kt b/idea/testData/quickfix/autoImports/falsePostfixOperator.before.Main.kt index 074be421492..e07f14b17ed 100644 --- a/idea/testData/quickfix/autoImports/falsePostfixOperator.before.Main.kt +++ b/idea/testData/quickfix/autoImports/falsePostfixOperator.before.Main.kt @@ -1,4 +1,4 @@ -// "Import" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ACTION: Create extension function 'H?.inc' // ACTION: Create member function 'H.inc' // ACTION: Replace overloaded operator with function call diff --git a/idea/testData/quickfix/autoImports/indexCallExtensionGetNoOperator.test b/idea/testData/quickfix/autoImports/indexCallExtensionGetNoOperator.test index ad6811a5cdc..0b251b99a1a 100644 --- a/idea/testData/quickfix/autoImports/indexCallExtensionGetNoOperator.test +++ b/idea/testData/quickfix/autoImports/indexCallExtensionGetNoOperator.test @@ -1,5 +1,5 @@ // FILE: first.before.kt -// "Import" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: foo()["str"] // ERROR: No get method providing array access // ACTION: Create extension function 'Some.get' diff --git a/idea/testData/quickfix/autoImports/indexCallNoImportWhenGetNeededButSetAvailable.test b/idea/testData/quickfix/autoImports/indexCallNoImportWhenGetNeededButSetAvailable.test index 075001b6402..20513c9fe8f 100644 --- a/idea/testData/quickfix/autoImports/indexCallNoImportWhenGetNeededButSetAvailable.test +++ b/idea/testData/quickfix/autoImports/indexCallNoImportWhenGetNeededButSetAvailable.test @@ -1,5 +1,5 @@ // FILE: first.before.kt -// "Import" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: foo()["str"] // ERROR: No set method providing array access // ACTION: Create extension function 'Some.set' diff --git a/idea/testData/quickfix/autoImports/indexCallNoImportWhenSetNeededButGetAvailable.test b/idea/testData/quickfix/autoImports/indexCallNoImportWhenSetNeededButGetAvailable.test index 8b847899de9..4cba4fd70d0 100644 --- a/idea/testData/quickfix/autoImports/indexCallNoImportWhenSetNeededButGetAvailable.test +++ b/idea/testData/quickfix/autoImports/indexCallNoImportWhenSetNeededButGetAvailable.test @@ -1,5 +1,5 @@ // FILE: first.before.kt -// "Import" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: foo()["str"] // ERROR: No get method providing array access // ACTION: Create extension function 'Some.get' diff --git a/idea/testData/quickfix/autoImports/infixCall2.before.Main.kt b/idea/testData/quickfix/autoImports/infixCall2.before.Main.kt index 220150f8f64..58558bf7e50 100644 --- a/idea/testData/quickfix/autoImports/infixCall2.before.Main.kt +++ b/idea/testData/quickfix/autoImports/infixCall2.before.Main.kt @@ -1,4 +1,4 @@ -// "Import" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Unresolved reference: foo // ACTION: Create extension function 'H.foo' // ACTION: Create member function 'H.foo' diff --git a/idea/testData/quickfix/autoImports/invokeExtensionNoOperator.test b/idea/testData/quickfix/autoImports/invokeExtensionNoOperator.test index b73f2fffeab..d1097d9808d 100644 --- a/idea/testData/quickfix/autoImports/invokeExtensionNoOperator.test +++ b/idea/testData/quickfix/autoImports/invokeExtensionNoOperator.test @@ -1,5 +1,5 @@ // FILE: first.before.kt -// "Import" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found // ACTION: Create extension function 'Some.invoke' // ACTION: Create member function 'Some.invoke' diff --git a/idea/testData/quickfix/autoImports/multiDeclarationExtensionComponentNoOperator.test b/idea/testData/quickfix/autoImports/multiDeclarationExtensionComponentNoOperator.test index 6b5587b24ad..e7251d14747 100644 --- a/idea/testData/quickfix/autoImports/multiDeclarationExtensionComponentNoOperator.test +++ b/idea/testData/quickfix/autoImports/multiDeclarationExtensionComponentNoOperator.test @@ -1,5 +1,5 @@ // FILE: first.before.kt -// "Import" "false" +// "class org.jetbrains.kotlin.idea.quickfix.ImportFix" "false" // ERROR: Destructuring declaration initializer of type Some must have a 'component1()' function // ACTION: Create extension function 'Some.component1' // ACTION: Create member function 'Some.component1' diff --git a/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt b/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt index 23187cbaec2..1fe4c8366b0 100644 --- a/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt +++ b/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt @@ -1,4 +1,4 @@ -// "Add non-null asserted (!!) call" "false" +// "class org.jetbrains.kotlin.idea.quickfix.AddExclExclCallFix" "false" // ACTION: Replace with a 'forEach' function call // ACTION: Surround with null check // ERROR: Not nullable value required to call an 'iterator()' method on for-loop range diff --git a/idea/testData/quickfix/foldTryCatch/conditional.kt b/idea/testData/quickfix/foldTryCatch/conditional.kt index 821894e9357..6afb729c8f1 100644 --- a/idea/testData/quickfix/foldTryCatch/conditional.kt +++ b/idea/testData/quickfix/foldTryCatch/conditional.kt @@ -1,4 +1,4 @@ -// "Lift assignment out of 'try' expression" "false" +// "class org.jetbrains.kotlin.idea.quickfix.LiftAssignmentOutOfTryFix" "false" // ACTION: Make variable mutable // ERROR: Val cannot be reassigned // WITH_RUNTIME diff --git a/idea/testData/quickfix/foldTryCatch/shadow.kt b/idea/testData/quickfix/foldTryCatch/shadow.kt index 54c7ffe86da..12363b51ad9 100644 --- a/idea/testData/quickfix/foldTryCatch/shadow.kt +++ b/idea/testData/quickfix/foldTryCatch/shadow.kt @@ -1,4 +1,4 @@ -// "Lift assignment out of 'try' expression" "false" +// "class org.jetbrains.kotlin.idea.quickfix.LiftAssignmentOutOfTryFix" "false" // ACTION: Make variable mutable // ERROR: Val cannot be reassigned // ERROR: Val cannot be reassigned diff --git a/idea/testData/quickfix/implement/incorrectRange.kt b/idea/testData/quickfix/implement/incorrectRange.kt index d8030dbda0a..4e085d7dad8 100644 --- a/idea/testData/quickfix/implement/incorrectRange.kt +++ b/idea/testData/quickfix/implement/incorrectRange.kt @@ -1,4 +1,4 @@ -// "Implement interface" "false" +// "class org.jetbrains.kotlin.idea.intentions.CreateKotlinSubClassIntention" "false" // ACTION: Convert function to property // ACTION: Convert member to extension diff --git a/idea/testData/quickfix/implement/local.kt b/idea/testData/quickfix/implement/local.kt index a8647eb53e5..54946752644 100644 --- a/idea/testData/quickfix/implement/local.kt +++ b/idea/testData/quickfix/implement/local.kt @@ -1,4 +1,4 @@ -// "Implement abstract class" "false" +// "class org.jetbrains.kotlin.idea.intentions.CreateKotlinSubClassIntention" "false" fun foo() { abstract class My { diff --git a/idea/testData/quickfix/implement/noDefaultConstructor.kt b/idea/testData/quickfix/implement/noDefaultConstructor.kt index f7adbb4ad65..6bae6e65abe 100644 --- a/idea/testData/quickfix/implement/noDefaultConstructor.kt +++ b/idea/testData/quickfix/implement/noDefaultConstructor.kt @@ -1,3 +1,3 @@ -// "Implement abstract class" "false" +// "class org.jetbrains.kotlin.idea.intentions.CreateKotlinSubClassIntention" "false" abstract class Base(val x: Int) \ No newline at end of file diff --git a/idea/testData/quickfix/implement/privateConstructor.kt b/idea/testData/quickfix/implement/privateConstructor.kt index 805076820bd..12be6b71e94 100644 --- a/idea/testData/quickfix/implement/privateConstructor.kt +++ b/idea/testData/quickfix/implement/privateConstructor.kt @@ -1,3 +1,3 @@ -// "Implement abstract class" "false" +// "class org.jetbrains.kotlin.idea.intentions.CreateKotlinSubClassIntention" "false" abstract class Base private constructor \ No newline at end of file diff --git a/idea/testData/quickfix/insertDelegationCall/nonApplicableWithOneConstructor.kt b/idea/testData/quickfix/insertDelegationCall/nonApplicableWithOneConstructor.kt index b611d2aa8e6..6d7f76c957e 100644 --- a/idea/testData/quickfix/insertDelegationCall/nonApplicableWithOneConstructor.kt +++ b/idea/testData/quickfix/insertDelegationCall/nonApplicableWithOneConstructor.kt @@ -1,4 +1,4 @@ -// "Insert 'this()' call" "false" +// "class org.jetbrains.kotlin.idea.quickfix.InsertDelegationCallQuickfix" "false" // ACTION: Insert 'super()' call // ERROR: Explicit 'this' or 'super' call is required. There is no constructor in superclass that can be called without arguments diff --git a/idea/testData/quickfix/insertDelegationCall/primaryRequiredNoSuper.kt b/idea/testData/quickfix/insertDelegationCall/primaryRequiredNoSuper.kt index e426305265e..af29c0f6b60 100644 --- a/idea/testData/quickfix/insertDelegationCall/primaryRequiredNoSuper.kt +++ b/idea/testData/quickfix/insertDelegationCall/primaryRequiredNoSuper.kt @@ -1,4 +1,4 @@ -// "Insert 'super()' call" "false" +// "class org.jetbrains.kotlin.idea.quickfix.InsertDelegationCallQuickfix" "false" // ACTION: Insert 'this()' call // ERROR: Primary constructor call expected diff --git a/idea/testData/quickfix/leakingThis/accessOverriddenProperty.kt b/idea/testData/quickfix/leakingThis/accessOverriddenProperty.kt index 2ff06f05af1..0be3554f664 100644 --- a/idea/testData/quickfix/leakingThis/accessOverriddenProperty.kt +++ b/idea/testData/quickfix/leakingThis/accessOverriddenProperty.kt @@ -1,4 +1,4 @@ -// "Make 'x' final" "false" +// "class org.jetbrains.kotlin.idea.quickfix.AddModifierFix" "false" // ACTION: Convert property initializer to getter open class My(open val x: Int) { diff --git a/idea/testData/quickfix/leakingThis/inAbstract.kt b/idea/testData/quickfix/leakingThis/inAbstract.kt index 4be3c129415..101fbdbfa94 100644 --- a/idea/testData/quickfix/leakingThis/inAbstract.kt +++ b/idea/testData/quickfix/leakingThis/inAbstract.kt @@ -1,4 +1,4 @@ -// "Make 'My' final" "false" +// "class org.jetbrains.kotlin.idea.quickfix.AddModifierFix" "false" // ACTION: Add 'my =' to argument abstract class My { diff --git a/idea/testData/quickfix/leakingThis/inOverridden.kt b/idea/testData/quickfix/leakingThis/inOverridden.kt index e3cb871707f..18d056e9452 100644 --- a/idea/testData/quickfix/leakingThis/inOverridden.kt +++ b/idea/testData/quickfix/leakingThis/inOverridden.kt @@ -1,4 +1,4 @@ -// "Make 'My' final" "false" +// "class org.jetbrains.kotlin.idea.quickfix.AddModifierFix" "false" // ACTION: Add 'my =' to argument open class My { diff --git a/idea/testData/quickfix/makeConstructorParameterProperty/override.kt b/idea/testData/quickfix/makeConstructorParameterProperty/override.kt index e5949aedcc3..a2b868f9435 100644 --- a/idea/testData/quickfix/makeConstructorParameterProperty/override.kt +++ b/idea/testData/quickfix/makeConstructorParameterProperty/override.kt @@ -1,4 +1,4 @@ -// "Make constructor parameter a property" "false" +// "class org.jetbrains.kotlin.idea.quickfix.MakeConstructorParameterPropertyFix" "false" // ERROR: Cannot access 'foo': it is invisible (private in a supertype) in 'A' open class Base(private val foo: String) diff --git a/idea/testData/quickfix/typeMismatch/addArrayOfTypeForJavaAnnotation.before.Main.kt b/idea/testData/quickfix/typeMismatch/addArrayOfTypeForJavaAnnotation.before.Main.kt index 0e195a4e94b..42a55ab384a 100644 --- a/idea/testData/quickfix/typeMismatch/addArrayOfTypeForJavaAnnotation.before.Main.kt +++ b/idea/testData/quickfix/typeMismatch/addArrayOfTypeForJavaAnnotation.before.Main.kt @@ -1,4 +1,4 @@ -// "Add arrayOf wrapper" "false" +// "class org.jetbrains.kotlin.idea.quickfix.AddArrayOfTypeFix" "false" // ACTION: Add 'value =' to argument // ACTION: Create test // ACTION: Make internal diff --git a/idea/testData/quickfix/typeMismatch/addExclExclToRemoveNullabilityDisabledWhenItCannotHelp.kt b/idea/testData/quickfix/typeMismatch/addExclExclToRemoveNullabilityDisabledWhenItCannotHelp.kt index 4799c240ecb..493f3ac9c75 100644 --- a/idea/testData/quickfix/typeMismatch/addExclExclToRemoveNullabilityDisabledWhenItCannotHelp.kt +++ b/idea/testData/quickfix/typeMismatch/addExclExclToRemoveNullabilityDisabledWhenItCannotHelp.kt @@ -1,4 +1,4 @@ -// "Add non-null asserted (!!) call" "false" +// "class org.jetbrains.kotlin.idea.quickfix.AddExclExclCallFix" "false" // ACTION: Change parameter 's' type of function 'other' to 'String?' // ACTION: Create function 'other' // ERROR: Type mismatch: inferred type is String? but Int was expected diff --git a/idea/testData/quickfix/when/twoElseBranchesInWhen.kt.after b/idea/testData/quickfix/when/twoElseBranchesInWhen.kt.after deleted file mode 100644 index ddf036a0336..00000000000 --- a/idea/testData/quickfix/when/twoElseBranchesInWhen.kt.after +++ /dev/null @@ -1,16 +0,0 @@ -// "Move else branch to the end" "false" -// ERROR: 'else' entry must be the last one in a when-expression -// ERROR: 'else' entry must be the last one in a when-expression -// ERROR: Unreachable code -// ERROR: Unreachable code -package foo - -fun foo() { - var i = 2 - when (i) { - 1, 2 -> { /* some code */ } - else -> { /* first else branch */ } - else -> { /* second else branch */ } - 3 -> { /* some other code */ } - } -} \ No newline at end of file