[kotlin] update test AbstractOverrideImplementTest to check member texts shown in chooser dialog

KTIJ-30739

GitOrigin-RevId: 702e09aa8cf679bc5bde0e3787d65ba411dfb698
This commit is contained in:
aleksandrina-streltsova
2024-07-29 10:03:19 +00:00
committed by intellij-monorepo-bot
parent 62528fb885
commit ccfe306eaf
210 changed files with 1138 additions and 104 deletions
@@ -5,6 +5,7 @@ package org.jetbrains.kotlin.idea.codeInsight
import com.intellij.codeInsight.generation.ClassMember
import com.intellij.codeInsight.generation.OverrideImplementUtil
import com.intellij.codeInsight.generation.PsiMethodMember
import com.intellij.grazie.utils.toLinkedSet
import com.intellij.psi.JavaPsiFacade
import com.intellij.psi.PsiClassOwner
import com.intellij.psi.PsiMethod
@@ -14,13 +15,14 @@ import com.intellij.psi.search.GlobalSearchScope
import com.intellij.psi.util.PsiTreeUtil
import com.intellij.testFramework.LightProjectDescriptor
import com.intellij.util.SmartList
import org.jetbrains.kotlin.idea.base.test.IgnoreTests
import org.jetbrains.kotlin.idea.base.test.InTextDirectivesUtils
import org.jetbrains.kotlin.idea.core.overrideImplement.AbstractGenerateMembersHandler
import org.jetbrains.kotlin.idea.test.*
import org.jetbrains.kotlin.idea.util.application.executeWriteCommand
import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.idea.base.test.IgnoreTests
import org.jetbrains.kotlin.idea.base.test.InTextDirectivesUtils
import org.jetbrains.kotlin.test.util.trimTrailingWhitespacesAndRemoveRedundantEmptyLinesAtTheEnd
import org.jetbrains.kotlin.utils.rethrow
import org.junit.Assert
import java.io.File
@@ -82,36 +84,48 @@ abstract class AbstractOverrideImplementTest<T : ClassMember> : KotlinLightCodeI
private fun doFileTest(handler: AbstractGenerateMembersHandler<T>, memberToOverride: String? = null) {
myFixture.configureByFile(getTestName(true) + ".kt")
doOverrideImplement(handler, memberToOverride)
checkResultByFile(getTestName(true))
val fileNameWithoutExtension = getTestName(true)
doOverrideImplement(handler, memberToOverride, fileNameWithoutExtension)
checkResultByFile(fileNameWithoutExtension)
}
private fun doMultiFileTest(handler: AbstractGenerateMembersHandler<T>) {
myFixture.configureByFile(getTestName(true) + ".kt")
doMultiOverrideImplement(handler)
checkResultByFile(getTestName(true))
val fileNameWithoutExtension = getTestName(true)
doMultiOverrideImplement(handler, fileNameWithoutExtension)
checkResultByFile(fileNameWithoutExtension)
}
private fun doDirectoryTest(handler: AbstractGenerateMembersHandler<T>, memberToOverride: String? = null) {
myFixture.copyDirectoryToProject(getTestName(true), "")
myFixture.configureFromTempProjectFile("foo/Impl.kt")
doOverrideImplement(handler, memberToOverride)
val filePathWithoutExtension = getTestName(true) + "/foo/Impl"
doOverrideImplement(handler, memberToOverride, filePathWithoutExtension)
checkResultByFile(getTestName(true) + "/foo/Impl")
}
private fun doMultiDirectoryTest(handler: AbstractGenerateMembersHandler<T>) {
myFixture.copyDirectoryToProject(getTestName(true), "")
myFixture.configureFromTempProjectFile("foo/Impl.kt")
doMultiOverrideImplement(handler)
checkResultByFile(getTestName(true) + "/foo/Impl")
val filePathWithoutExtension = getTestName(true) + "/foo/Impl"
doMultiOverrideImplement(handler, filePathWithoutExtension)
checkResultByFile(filePathWithoutExtension)
}
private fun doOverrideImplement(handler: AbstractGenerateMembersHandler<T>, memberToOverride: String?) {
private fun doOverrideImplement(
handler: AbstractGenerateMembersHandler<T>,
memberToOverride: String?,
fileNameWithoutExtension: String,
) {
val elementAtCaret = myFixture.file.findElementAt(myFixture.editor.caretModel.offset)
val classOrObject = PsiTreeUtil.getParentOfType(elementAtCaret, KtClassOrObject::class.java)
?: error("Caret should be inside class or object")
val chooserObjects = handler.collectMembersToGenerateUnderProgress(classOrObject)
val chooserObjects = collectAndCheckChooserObjects(fileNameWithoutExtension, handler, classOrObject)
val singleToOverride = if (memberToOverride == null) {
val filtered = chooserObjects.filter { !isMemberOfAny(classOrObject, it) }
@@ -126,7 +140,7 @@ abstract class AbstractOverrideImplementTest<T : ClassMember> : KotlinLightCodeI
performGenerateCommand(handler, classOrObject, listOf(singleToOverride))
}
private fun doMultiOverrideImplement(handler: AbstractGenerateMembersHandler<T>) {
private fun doMultiOverrideImplement(handler: AbstractGenerateMembersHandler<T>, fileNameWithoutExtension: String) {
if (isFirPlugin && InTextDirectivesUtils.isDirectiveDefined(myFixture.file.text, IgnoreTests.DIRECTIVES.IGNORE_K2)) {
return
}
@@ -134,7 +148,7 @@ abstract class AbstractOverrideImplementTest<T : ClassMember> : KotlinLightCodeI
val classOrObject = PsiTreeUtil.getParentOfType(elementAtCaret, KtClassOrObject::class.java)
?: error("Caret should be inside class or object")
val chooserObjects = handler.collectMembersToGenerateUnderProgress(classOrObject)
val chooserObjects = collectAndCheckChooserObjects(fileNameWithoutExtension, handler, classOrObject)
.sortedBy { getMemberName(classOrObject, it) + " in " + getContainingClassName(classOrObject, it) }
performGenerateCommand(handler, classOrObject, chooserObjects)
}
@@ -226,4 +240,54 @@ abstract class AbstractOverrideImplementTest<T : ClassMember> : KotlinLightCodeI
)
}
}
private fun collectAndCheckChooserObjects(
fileNameWithoutExtension: String,
handler: AbstractGenerateMembersHandler<T>,
classOrObject: KtClassOrObject,
addMissingDirectives: Boolean = false,
): Collection<T> {
val chooserObjects = handler.collectMembersToGenerateUnderProgress(classOrObject)
val testFile = File(testDataDirectory, "$fileNameWithoutExtension.kt")
val actualMemberTexts = chooserObjects.map { it.text }.toLinkedSet()
val expectedMemberTexts = InTextDirectivesUtils.findListWithPrefixes(testFile.readText(), MEMBER_DIRECTIVE_PREFIX).toLinkedSet()
if (addMissingDirectives) {
actualMemberTexts
.filterNot { it in expectedMemberTexts }
.takeIf { it.isNotEmpty() }
?.let { missingActualMemberTexts ->
val missingDirectives = missingActualMemberTexts.map { "$MEMBER_DIRECTIVE_PREFIX \"$it\"" }
addDirectivesToFile(testFile, missingDirectives)
val testFilePath = testFile.path
val testResultFiles = listOf("after", "fir.after").map { File("$testFilePath.$it") }.filter { it.exists() }
for (testResultFile in testResultFiles) {
addDirectivesToFile(testResultFile, missingDirectives)
}
}
}
expectedMemberTexts.minus(actualMemberTexts).firstOrNull()?.let { missingMemberText ->
Assert.fail("Expected '${missingMemberText}' not found in:\n${getCollectionRepresentation(actualMemberTexts)}")
}
return chooserObjects
}
private fun addDirectivesToFile(file: File, directives: List<String>) {
val fileText = file.readText().trimTrailingWhitespacesAndRemoveRedundantEmptyLinesAtTheEnd()
file.writeText(fileText + directives.joinToString(prefix = "\n", separator = "\n"))
}
private fun getCollectionRepresentation(collection: Collection<*>): String = collection.joinToString(separator = "\n")
companion object {
protected const val MEMBER_TEXT = "MEMBER"
protected const val MEMBER_DIRECTIVE_PREFIX = "// $MEMBER_TEXT:"
}
}
@@ -9,4 +9,6 @@ interface U {
class C1 : T, U {
<caret>
}
}
// MEMBER: "getFoo(): String"
@@ -11,4 +11,6 @@ class C1 : T, U {
override fun getFoo(): String {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "getFoo(): String"
@@ -8,4 +8,9 @@ open class A {
class C : A(), I {
<caret>
}
}
// MEMBER: "foo(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -28,4 +28,9 @@ class C : A(), I {
override fun toString(): String {
return super.toString()
}
}
}
// MEMBER: "foo(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -28,4 +28,9 @@ class C : A(), I {
override fun toString(): String {
return super.toString()
}
}
}
// MEMBER: "foo(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -4,3 +4,8 @@ import foo.A
class B : A() {
<caret>
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
// MEMBER: "foo(s1: String!, s2: String!): String!"
@@ -6,3 +6,8 @@ class B : A() {
return super.foo(s1, s2)
}
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
// MEMBER: "foo(s1: String!, s2: String!): String!"
@@ -8,3 +8,10 @@ open class Base<A, B, C>() {
class C : Base<String, C, Unit>() {
<caret>
}
// MEMBER: "method: (String?) -> String"
// MEMBER: "foo(value: C): C"
// MEMBER: "bar(value: () -> Unit): (String) -> Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -29,3 +29,10 @@ class C : Base<String, C, Unit>() {
return super.toString()
}
}
// MEMBER: "method: (String?) -> String"
// MEMBER: "foo(value: C): C"
// MEMBER: "bar(value: () -> Unit): (String) -> Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -6,3 +6,8 @@ import foo.A
class B : A() {
<caret>
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
// MEMBER: "foo(): Int"
@@ -11,3 +11,8 @@ class B : A() {
<selection><caret>return super.foo()</selection>
}
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
// MEMBER: "foo(): Int"
@@ -9,3 +9,8 @@ open class ParentTarget {
class ChildTarget : ParentTarget() {
<caret>
}
// MEMBER: "targetFun(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -12,3 +12,8 @@ class ChildTarget : ParentTarget() {
<selection><caret>super.targetFun()</selection>
}
}
// MEMBER: "targetFun(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -10,4 +10,9 @@ open class ParentTarget {
class ChildTarget : ParentTarget() {
<caret>
}
}
// MEMBER: "targetFun(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -13,4 +13,9 @@ class ChildTarget : ParentTarget() {
override fun targetFun() {
<selection><caret>super.targetFun()</selection>
}
}
}
// MEMBER: "targetFun(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -9,4 +9,9 @@ abstract class A {
class B : A() {
<caret>
}
}
// MEMBER: "foo(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -14,4 +14,9 @@ class B : A() {
override fun foo() {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "foo(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -1,4 +1,8 @@
// FIR_IDENTICAL
data class Foo(val name: String) {
<caret>
}
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -3,4 +3,8 @@ data class Foo(val name: String) {
override fun equals(other: Any?): Boolean {
<selection>return super.equals(other)</selection>
}
}
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -5,4 +5,6 @@ interface T {
class C : T {
<caret>
}
}
// MEMBER: "foo(a: Int = ...): Unit"
@@ -7,4 +7,6 @@ class C : T {
override fun foo(a: Int) {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "foo(a: Int = ...): Unit"
@@ -8,4 +8,10 @@ class C(t :T) : T by t {
<caret>
}
// KT-5103
// KT-5103
// MEMBER: "foo(): Unit"
// MEMBER: "bar(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -26,4 +26,10 @@ class C(t :T) : T by t {
}
}
// KT-5103
// KT-5103
// MEMBER: "foo(): Unit"
// MEMBER: "bar(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -17,3 +17,9 @@ abstract class B : A() {
class C : B(), I {
<caret>
}
// MEMBER: "f(): Unit"
// MEMBER: "g(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -35,3 +35,9 @@ class C : B(), I {
return super.toString()
}
}
// MEMBER: "f(): Unit"
// MEMBER: "g(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -16,4 +16,14 @@ open class B: A() {
class C: B() {
<caret>
}
}
// MEMBER: "fOverride(): Unit"
// MEMBER: "vLateinit: String"
// MEMBER: "contains(n: Int): Boolean"
// MEMBER: "fInfix(n: Int): Unit"
// MEMBER: "fProtected(): Unit"
// MEMBER: "fInternal(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -51,3 +51,13 @@ class C: B() {
get() = super.vLateinit
set(value) {}
}
// MEMBER: "fOverride(): Unit"
// MEMBER: "vLateinit: String"
// MEMBER: "contains(n: Int): Boolean"
// MEMBER: "fInfix(n: Int): Unit"
// MEMBER: "fProtected(): Unit"
// MEMBER: "fInternal(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -8,3 +8,8 @@ open class ParentTarget {
class ChildTarget : ParentTarget() {
<caret>
}
// MEMBER: "targetFun(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -10,3 +10,8 @@ class ChildTarget : ParentTarget() {
<selection><caret>super.targetFun()</selection>
}
}
// MEMBER: "targetFun(): Unit"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -7,3 +7,7 @@ interface I
class B : A<String>(), I {
<caret>
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -17,3 +17,7 @@ class B : A<String>(), I {
return super.toString()
}
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -4,4 +4,6 @@ interface T {
fun Foo() : (String) -> Unit
}
class C : <caret>T
class C : <caret>T
// MEMBER: "Foo(): (String) -> Unit"
@@ -8,4 +8,6 @@ class C : T {
override fun Foo(): (String) -> Unit {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "Foo(): (String) -> Unit"
@@ -1,2 +1,4 @@
// FIR_IDENTICAL
enum <caret>class Foo
enum <caret>class Foo
// MEMBER: "toString(): String"
@@ -5,4 +5,6 @@ enum class Foo {
override fun toString(): String {
<selection><caret>return super.toString()</selection>
}
}
}
// MEMBER: "toString(): String"
@@ -1,3 +1,5 @@
// FIR_IDENTICAL
enum <caret>class Foo {
}
}
// MEMBER: "toString(): String"
@@ -5,4 +5,6 @@ enum class Foo {
override fun toString(): String {
<selection><caret>return super.toString()</selection>
}
}
}
// MEMBER: "toString(): String"
@@ -1,4 +1,6 @@
// FIR_IDENTICAL
enum <caret>class Foo {
A
}
}
// MEMBER: "toString(): String"
@@ -5,4 +5,6 @@ enum class Foo {
override fun toString(): String {
<selection><caret>return super.toString()</selection>
}
}
}
// MEMBER: "toString(): String"
@@ -1,4 +1,6 @@
// FIR_IDENTICAL
enum <caret>class Foo {
A;
}
}
// MEMBER: "toString(): String"
@@ -5,4 +5,6 @@ enum class Foo {
override fun toString(): String {
<selection><caret>return super.toString()</selection>
}
}
}
// MEMBER: "toString(): String"
@@ -3,4 +3,8 @@ interface A
interface B : A {
<caret>
}
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -3,4 +3,8 @@ interface A
interface B : A {
override fun equals(other: Any?): Boolean
}
}
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -6,3 +6,8 @@ open class A {
class C : A() {
<caret>
}
// MEMBER: "foo(`object`: Any): Int"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -8,3 +8,8 @@ class C : A() {
<selection><caret>return super.foo(`object`)</selection>
}
}
// MEMBER: "foo(`object`: Any): Int"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
@@ -6,4 +6,6 @@ interface T {
class C : T {
<caret>
}
}
// MEMBER: "Foo(): (String) -> Unit"
@@ -8,4 +8,6 @@ class C : T {
override fun Foo(): (String) -> Unit {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "Foo(): (String) -> Unit"
@@ -8,4 +8,6 @@ fun some() : A {
return object : A {<caret>}
}
// TODO: need better selection and caret
// TODO: need better selection and caret
// MEMBER: "method: () -> Unit?"
@@ -11,4 +11,6 @@ fun some() : A {
}
}
// TODO: need better selection and caret
// TODO: need better selection and caret
// MEMBER: "method: () -> Unit?"
@@ -4,4 +4,6 @@ interface Interface {
class InterfaceImpl : Interface {
<caret>
}
}
// MEMBER: "foo(): Unit where B : Cloneable, B : Comparable<B>"
@@ -6,4 +6,6 @@ class InterfaceImpl : Interface {
override fun <A, B : Runnable, E : Map.Entry<A, B>> foo() where B : Cloneable, B : Comparable<B> {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "foo(): Unit where B : Cloneable, B : Comparable<B>"
@@ -6,4 +6,6 @@ class InterfaceImpl : Interface {
override fun <A, B, E : Map.Entry<A, B>> foo() where B : Runnable, B : Cloneable, B : Comparable<B> {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "foo(): Unit where B : Cloneable, B : Comparable<B>"
@@ -9,4 +9,8 @@ interface Some<T> {
class SomeOther<S> : Some<S> {
<caret>
}
}
// MEMBER: "someFoo(): Unit"
// MEMBER: "someOtherFoo(): Int"
// MEMBER: "someGenericFoo(): S"
@@ -19,4 +19,8 @@ class SomeOther<S> : Some<S> {
override fun someOtherFoo(): Int {
TODO("Not yet implemented")
}
}
}
// MEMBER: "someFoo(): Unit"
// MEMBER: "someOtherFoo(): Int"
// MEMBER: "someGenericFoo(): S"
@@ -13,3 +13,6 @@ class <caret>C : I<Int> {
override fun <U> d(t: Int, u: U) {
}
}
// MEMBER: "a(t: Int, u: U): Unit"
// MEMBER: "c(t: Int): Unit"
@@ -21,3 +21,6 @@ class C : I<Int> {
override fun <U> d(t: Int, u: U) {
}
}
// MEMBER: "a(t: Int, u: U): Unit"
// MEMBER: "c(t: Int): Unit"
@@ -6,3 +6,5 @@ interface G<T> {
class GC() : G<Int> {
<caret>
}
// MEMBER: "foo(t: Int): Int"
@@ -8,3 +8,5 @@ class GC() : G<Int> {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "foo(t: Int): Int"
@@ -1,4 +1,43 @@
// FIR_IDENTICAL
abstract class X : java.util.ArrayList<String>(), Runnable {
<caret>
}
}
// MEMBER: "add(element: String): Boolean"
// MEMBER: "add(index: Int, element: String): Unit"
// MEMBER: "addAll(elements: Collection<String>): Boolean"
// MEMBER: "addAll(index: Int, elements: Collection<String>): Boolean"
// MEMBER: "clear(): Unit"
// MEMBER: "iterator(): MutableIterator<String>"
// MEMBER: "remove(element: String): Boolean"
// MEMBER: "removeAll(elements: Collection<String>): Boolean"
// MEMBER: "retainAll(elements: Collection<String>): Boolean"
// MEMBER: "contains(element: String): Boolean"
// MEMBER: "containsAll(elements: Collection<String!>): Boolean"
// MEMBER: "isEmpty(): Boolean"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
// MEMBER: "forEach(p0: Consumer<in String!>!): Unit"
// MEMBER: "spliterator(): Spliterator<String!>"
// MEMBER: "toArray(): Array<(out) Any!>!"
// MEMBER: "toArray(p0: Array<(out) T!>!): Array<(out) T!>!"
// MEMBER: "removeIf(p0: Predicate<in String>): Boolean"
// MEMBER: "stream(): Stream<String!>"
// MEMBER: "parallelStream(): Stream<String!>"
// MEMBER: "listIterator(index: Int): MutableListIterator<String>"
// MEMBER: "listIterator(): MutableListIterator<String>"
// MEMBER: "removeAt(p0: Int): String"
// MEMBER: "set(index: Int, element: String): String"
// MEMBER: "subList(fromIndex: Int, toIndex: Int): MutableList<String>"
// MEMBER: "get(index: Int): String"
// MEMBER: "indexOf(element: String): Int"
// MEMBER: "lastIndexOf(element: String): Int"
// MEMBER: "replaceAll(p0: UnaryOperator<String>): Unit"
// MEMBER: "sort(p0: Comparator<in String!>!): Unit"
// MEMBER: "removeRange(p0: Int, p1: Int): Unit"
// MEMBER: "clone(): Any"
// MEMBER: "trimToSize(): Unit"
// MEMBER: "ensureCapacity(p0: Int): Unit"
// MEMBER: "size: Int"
// MEMBER: "run(): Unit"
@@ -3,4 +3,43 @@ abstract class X : java.util.ArrayList<String>(), Runnable {
override fun iterator(): MutableIterator<String> {
<selection><caret>return super.iterator()</selection>
}
}
}
// MEMBER: "add(element: String): Boolean"
// MEMBER: "add(index: Int, element: String): Unit"
// MEMBER: "addAll(elements: Collection<String>): Boolean"
// MEMBER: "addAll(index: Int, elements: Collection<String>): Boolean"
// MEMBER: "clear(): Unit"
// MEMBER: "iterator(): MutableIterator<String>"
// MEMBER: "remove(element: String): Boolean"
// MEMBER: "removeAll(elements: Collection<String>): Boolean"
// MEMBER: "retainAll(elements: Collection<String>): Boolean"
// MEMBER: "contains(element: String): Boolean"
// MEMBER: "containsAll(elements: Collection<String!>): Boolean"
// MEMBER: "isEmpty(): Boolean"
// MEMBER: "equals(other: Any?): Boolean"
// MEMBER: "hashCode(): Int"
// MEMBER: "toString(): String"
// MEMBER: "forEach(p0: Consumer<in String!>!): Unit"
// MEMBER: "spliterator(): Spliterator<String!>"
// MEMBER: "toArray(): Array<(out) Any!>!"
// MEMBER: "toArray(p0: Array<(out) T!>!): Array<(out) T!>!"
// MEMBER: "removeIf(p0: Predicate<in String>): Boolean"
// MEMBER: "stream(): Stream<String!>"
// MEMBER: "parallelStream(): Stream<String!>"
// MEMBER: "listIterator(index: Int): MutableListIterator<String>"
// MEMBER: "listIterator(): MutableListIterator<String>"
// MEMBER: "removeAt(p0: Int): String"
// MEMBER: "set(index: Int, element: String): String"
// MEMBER: "subList(fromIndex: Int, toIndex: Int): MutableList<String>"
// MEMBER: "get(index: Int): String"
// MEMBER: "indexOf(element: String): Int"
// MEMBER: "lastIndexOf(element: String): Int"
// MEMBER: "replaceAll(p0: UnaryOperator<String>): Unit"
// MEMBER: "sort(p0: Comparator<in String!>!): Unit"
// MEMBER: "removeRange(p0: Int, p1: Int): Unit"
// MEMBER: "clone(): Any"
// MEMBER: "trimToSize(): Unit"
// MEMBER: "ensureCapacity(p0: Int): Unit"
// MEMBER: "size: Int"
// MEMBER: "run(): Unit"
@@ -3,4 +3,6 @@
class MyClass<A: Comparable<A>> : Iterable<A> {
<caret>
}
}
// MEMBER: "iterator(): Iterator<A>"
@@ -5,4 +5,6 @@ class MyClass<A: Comparable<A>> : Iterable<A> {
override fun iterator(): Iterator<A> {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "iterator(): Iterator<A>"
@@ -6,4 +6,6 @@ interface Runnable {
class <caret>A : Runnable {
fun foo() {
}
}
}
// MEMBER: "run(): Unit"
@@ -10,4 +10,6 @@ class A : Runnable {
override fun run() {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "run(): Unit"
@@ -16,4 +16,11 @@ class <caret>Test : A {
override fun a6() {
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a2(): Unit"
// MEMBER: "a4(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
@@ -40,4 +40,11 @@ class Test : A {
override fun a8() {
TODO("Not yet implemented")
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a2(): Unit"
// MEMBER: "a4(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
@@ -16,4 +16,11 @@ class <caret>Test : A {
override fun a3() {
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a2(): Unit"
// MEMBER: "a4(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
@@ -40,4 +40,11 @@ class Test : A {
override fun a5() {
TODO("Not yet implemented")
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a2(): Unit"
// MEMBER: "a4(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
@@ -19,4 +19,10 @@ class <caret>Test : A {
override fun a2() {
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a3(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
@@ -39,4 +39,10 @@ class Test : A {
override fun a3() {
TODO("Not yet implemented")
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a3(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
@@ -25,4 +25,11 @@ class <caret>Test : A {
fun baz() {
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a2(): Unit"
// MEMBER: "a4(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
@@ -49,4 +49,11 @@ class Test : A {
fun baz() {
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a2(): Unit"
// MEMBER: "a4(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
@@ -25,4 +25,13 @@ class <caret>Test : A, B {
override fun a6() {
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a2(): Unit"
// MEMBER: "a4(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
// MEMBER: "b3(): Unit"
// MEMBER: "b1(): Unit"
@@ -57,4 +57,13 @@ class Test : A, B {
override fun a8() {
TODO("Not yet implemented")
}
}
}
// MEMBER: "a1(): Unit"
// MEMBER: "a2(): Unit"
// MEMBER: "a4(): Unit"
// MEMBER: "a5(): Unit"
// MEMBER: "a7(): Unit"
// MEMBER: "a8(): Unit"
// MEMBER: "b3(): Unit"
// MEMBER: "b1(): Unit"
@@ -1,4 +1,6 @@
// FIR_IDENTICAL
class C : (String) -> Boolean {
<caret>
}
}
// MEMBER: "invoke(p1: String): Boolean"
@@ -3,4 +3,6 @@ class C : (String) -> Boolean {
override fun invoke(p1: String): Boolean {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "invoke(p1: String): Boolean"
@@ -3,3 +3,5 @@ import foo.A
class C : A() {
<caret>
}
// MEMBER: "foo(x: (Mutable)List<(raw) Any?>!, y: String!): B<(raw) Any!>!"
@@ -6,3 +6,5 @@ class C : A() {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "foo(x: (Mutable)List<(raw) Any?>!, y: String!): B<(raw) Any!>!"
@@ -8,3 +8,5 @@ class C : A() {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "foo(x: (Mutable)List<(raw) Any?>!, y: String!): B<(raw) Any!>!"
@@ -4,3 +4,5 @@ package foo
class Impl: B {
<caret>
}
// MEMBER: "foo(r: Runnable!): Unit"
@@ -6,3 +6,5 @@ class Impl: B {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "foo(r: Runnable!): Unit"
@@ -4,3 +4,5 @@ interface I {
}
class C<caret> : I // comment
// MEMBER: "foo(): Unit"
@@ -8,3 +8,5 @@ class C : I { // comment
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "foo(): Unit"
@@ -4,3 +4,5 @@ interface I {
}
class C<caret> : I /* comment1 */ // comment2
// MEMBER: "foo(): Unit"
@@ -8,3 +8,5 @@ class C : I { /* comment1 */ // comment2
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "foo(): Unit"
@@ -5,3 +5,5 @@ interface I {
class C<caret> : I { // comment
}
// MEMBER: "foo(): Unit"
@@ -8,3 +8,5 @@ class C : I { // comment
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "foo(): Unit"
@@ -6,3 +6,5 @@ interface I {
class C<caret> : I { // comment1
// comment2
}
// MEMBER: "foo(): Unit"
@@ -9,3 +9,5 @@ class C : I { // comment1
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "foo(): Unit"
@@ -5,4 +5,6 @@ interface G<T> {
class GC<T>() : G<T> {
<caret>
}
}
// MEMBER: "foo(t: T): T"
@@ -7,4 +7,6 @@ class GC<T>() : G<T> {
override fun foo(t: T): T {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "foo(t: T): T"
@@ -5,4 +5,6 @@ interface Some {
class SomeOther : Some {
<caret>
}
}
// MEMBER: "foo(some: Int?): Int"
@@ -7,4 +7,6 @@ class SomeOther : Some {
override fun foo(some: Int?): Int {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
}
// MEMBER: "foo(some: Int?): Int"
@@ -3,3 +3,5 @@ import foo.Intf
class Impl(): Intf {
<caret>
}
// MEMBER: "getFooBar(): String!"
@@ -5,3 +5,5 @@ class Impl(): Intf {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "getFooBar(): String!"
@@ -5,3 +5,5 @@ class Impl(): Intf {
<selection><caret>TODO("Not yet implemented")</selection>
}
}
// MEMBER: "getFooBar(): String!"
@@ -3,3 +3,10 @@ package foo
class <caret>Impl : TestJavaInterface {
}
// MEMBER: "onTextEvent(): Unit"
// MEMBER: "onAttachmentEvent(): Unit"
// MEMBER: "onEventDeleted(): Unit"
// MEMBER: "onSeenReceipt(): Unit"
// MEMBER: "onDeliveredReceipt(): Unit"
// MEMBER: "onTypingEvent(): Unit"
@@ -26,3 +26,10 @@ class Impl : TestJavaInterface {
TODO("Not yet implemented")
}
}
// MEMBER: "onTextEvent(): Unit"
// MEMBER: "onAttachmentEvent(): Unit"
// MEMBER: "onEventDeleted(): Unit"
// MEMBER: "onSeenReceipt(): Unit"
// MEMBER: "onDeliveredReceipt(): Unit"
// MEMBER: "onTypingEvent(): Unit"
@@ -2,3 +2,5 @@ package foo
class <caret>Impl : TestJavaInterface<String> {
}
// MEMBER: "onTypingEvent(): T!"

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