FIR IDE: ignore not passing quickfixes tests

This commit is contained in:
Ilya Kirillov
2021-02-03 11:03:01 +01:00
parent 6c81d9848d
commit d72a2d39da
47 changed files with 91 additions and 22 deletions
@@ -6,9 +6,22 @@
package org.jetbrains.kotlin.idea.quickfix
import com.intellij.codeInsight.intention.IntentionAction
import org.jetbrains.kotlin.test.uitls.IgnoreTests
import java.nio.file.Paths
abstract class AbstractHighLevelQuickFixTest : AbstractQuickFixTest() {
override fun doTest(beforeFileName: String) {
IgnoreTests.runTestIfEnabledByFileDirective(
Paths.get(beforeFileName),
enableTestDirective = IgnoreTests.DIRECTIVES.FIR_COMPARISON_MUTLTILINE_COMMENT,
directivePosition = IgnoreTests.DirectivePosition.LAST_LINE_IN_FILE,
additionalFilesExtensions = arrayOf("after")
) {
super.doTest(beforeFileName)
}
}
override fun checkForUnexpectedErrors() {}
override fun checkAvailableActionsAreExpected(actions: List<IntentionAction>) {}
}
@@ -10,7 +10,7 @@ import java.nio.file.Files
import java.nio.file.Path
object IgnoreTests {
private const val INSERT_DIRECTIVE_AUTOMATICALLY = false // TODO use environment variable instead
private const val INSERT_DIRECTIVE_AUTOMATICALLY = true // TODO use environment variable instead
private const val ALWAYS_CONSIDER_TEST_AS_PASSING = false // TODO use environment variable instead
fun runTestIfEnabledByFileDirective(
@@ -136,6 +136,7 @@ object IgnoreTests {
object DIRECTIVES {
const val FIR_COMPARISON = "// FIR_COMPARISON"
const val FIR_COMPARISON_MUTLTILINE_COMMENT = "/* FIR_COMPARISON */"
const val IGNORE_FIR = "// IGNORE_FIR"
const val FIX_ME = "// FIX_ME: "
}
@@ -1,3 +1,4 @@
// "class org.jetbrains.kotlin.idea.quickfix.MakeClassAnAnnotationClassFix" "false"
// ERROR: 'String' is not an annotation class
@String<caret> class foo {}
/* FIR_COMPARISON */
@@ -5,3 +5,4 @@ class A() {
annotation class <caret>C
}
}
/* FIR_COMPARISON */
+1
View File
@@ -7,3 +7,4 @@ class A() {
data class <caret>C
}
}
/* FIR_COMPARISON */
+1
View File
@@ -7,3 +7,4 @@ class A() {
enum class <caret>C
}
}
/* FIR_COMPARISON */
+1
View File
@@ -6,3 +6,4 @@ class A() {
interface <caret>C
}
}
/* FIR_COMPARISON */
+1
View File
@@ -6,3 +6,4 @@ class A() {
object <caret>C
}
}
/* FIR_COMPARISON */
+1
View File
@@ -8,3 +8,4 @@ class A() {
sealed class <caret>C
}
}
/* FIR_COMPARISON */
@@ -9,4 +9,5 @@ interface T {
fun test() {
val o = <caret>object : T {}
}
}
/* FIR_COMPARISON */
@@ -9,3 +9,4 @@ interface T {
}
object <caret>Some : T
/* FIR_COMPARISON */
+2 -1
View File
@@ -10,4 +10,5 @@
class A {
private var a: String?<caret>
}
}
/* FIR_COMPARISON */
+2 -1
View File
@@ -11,4 +11,5 @@
class A {
private var a: Int<caret>
}
}
/* FIR_COMPARISON */
@@ -2,4 +2,5 @@
interface My {
<caret>open fun foo()
}
}
/* FIR_COMPARISON */
@@ -2,4 +2,5 @@
interface My {
fun foo()
}
}
/* FIR_COMPARISON */
@@ -3,3 +3,4 @@
class A private <caret>protected constructor() {
}
/* FIR_COMPARISON */
@@ -3,3 +3,4 @@
class A private constructor() {
}
/* FIR_COMPARISON */
@@ -12,4 +12,5 @@ interface B {
interface C : A, B {
override val x: (Int) -> Int<caret>
}
}
/* FIR_COMPARISON */
@@ -11,3 +11,4 @@ interface B {
interface C : A, B {
override var x: String<caret>
}
/* FIR_COMPARISON */
@@ -11,3 +11,4 @@ interface B {
interface C : A, B {
override var x: Int<caret>
}
/* FIR_COMPARISON */
@@ -11,3 +11,5 @@ interface B {
interface C : A, B {
override fun foo(): <caret>Long
}
/* FIR_COMPARISON */
@@ -9,4 +9,5 @@ interface B {
interface C : A, B {
override val x: (Int) -> Int<caret>
}
}
/* FIR_COMPARISON */
@@ -9,4 +9,5 @@ interface B {
interface C : A, B {
override val x: (Int) -> Int<caret>
}
}
/* FIR_COMPARISON */
@@ -9,4 +9,5 @@ interface B {
interface C : A, B {
override var x: String<caret>
}
}
/* FIR_COMPARISON */
@@ -9,4 +9,5 @@ interface B {
interface C : A, B {
override var x: String<caret>
}
}
/* FIR_COMPARISON */
@@ -3,4 +3,5 @@ interface A {
val x: CharSequence
}
class B(override val x: Any<caret>) : A
class B(override val x: Any<caret>) : A
/* FIR_COMPARISON */
@@ -3,4 +3,5 @@ interface A {
val x: Any
}
class B(override val x: Any) : A
class B(override val x: Any) : A
/* FIR_COMPARISON */
@@ -3,4 +3,5 @@ interface A {
val x: CharSequence
}
class B(override val x: Any<caret>) : A
class B(override val x: Any<caret>) : A
/* FIR_COMPARISON */
@@ -3,4 +3,5 @@ interface A {
val x: CharSequence
}
class B(override val x: CharSequence) : A
class B(override val x: CharSequence) : A
/* FIR_COMPARISON */
@@ -4,4 +4,5 @@ interface A {
}
interface B : A {
override var x: (Int) -> String<caret>
}
}
/* FIR_COMPARISON */
@@ -4,4 +4,5 @@ interface A {
}
interface B : A {
override var x: (String) -> Int
}
}
/* FIR_COMPARISON */
@@ -9,4 +9,5 @@ interface B {
interface C : A, B {
override fun foo(): Long<caret>
}
}
/* FIR_COMPARISON */
@@ -9,4 +9,5 @@ interface B {
interface C : A, B {
override fun foo(): Long<caret>
}
}
/* FIR_COMPARISON */
@@ -5,4 +5,5 @@ interface X {
class A : X {
override val x: Number<caret> = 42
}
}
/* FIR_COMPARISON */
@@ -5,4 +5,5 @@ interface X {
class A : X {
override val x: Int = 42
}
}
/* FIR_COMPARISON */
@@ -6,3 +6,5 @@ abstract class A {
abstract class B : A() {
override abstract var x: Long<caret>
}
/* FIR_COMPARISON */
@@ -6,3 +6,5 @@ abstract class A {
abstract class B : A() {
override abstract var x: Int
}
/* FIR_COMPARISON */
@@ -13,3 +13,5 @@ interface X {
abstract class B : A(), X {
override abstract fun foo(): Int<caret>
}
/* FIR_COMPARISON */
@@ -13,3 +13,5 @@ interface X {
abstract class B : A(), X {
override abstract fun foo(): T
}
/* FIR_COMPARISON */
@@ -14,3 +14,4 @@ interface X {
abstract class B : A(), X {
abstract override fun foo() : String<caret>
}
/* FIR_COMPARISON */
@@ -6,3 +6,5 @@ abstract class A {
abstract class B : A() {
abstract override fun foo(): Long<caret>
}
/* FIR_COMPARISON */
@@ -6,3 +6,5 @@ abstract class A {
abstract class B : A() {
abstract override fun foo(): Int
}
/* FIR_COMPARISON */
@@ -6,3 +6,5 @@ abstract class A {
abstract class B : A() {
abstract override fun foo<caret>()
}
/* FIR_COMPARISON */
@@ -6,3 +6,5 @@ abstract class A {
abstract class B : A() {
abstract override fun foo<caret>(): Int
}
/* FIR_COMPARISON */
@@ -2,3 +2,5 @@
abstract class A : java.util.Iterator<Int> {
public abstract override fun remove() : Int<caret>;
}
/* FIR_COMPARISON */
@@ -2,3 +2,5 @@
abstract class A : java.util.Iterator<Int> {
public abstract override fun remove();
}
/* FIR_COMPARISON */
@@ -51,7 +51,7 @@ abstract class AbstractQuickFixTest : KotlinLightCodeInsightFixtureTestCase(), Q
}
@Throws(Exception::class)
protected fun doTest(beforeFileName: String) {
protected open fun doTest(beforeFileName: String) {
val beforeFileText = FileUtil.loadFile(File(beforeFileName))
withCustomCompilerOptions(beforeFileText, project, module) {
val inspections = parseInspectionsToEnable(beforeFileName, beforeFileText).toTypedArray()