mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-21 13:20:56 +07:00
To better highlight that this test framework is for internal usage only. #IDEA-334017 GitOrigin-RevId: c491de2411cdffd6eee3e97a6273982560572f4b
38 lines
1.2 KiB
Kotlin
38 lines
1.2 KiB
Kotlin
package com.intellij.codeInspection.tests.kotlin
|
|
|
|
import com.intellij.jvm.analysis.internal.testFramework.ObsoleteApiUsageInspectionTestBase
|
|
import com.intellij.jvm.analysis.testFramework.JvmLanguage
|
|
|
|
class KotlinObsoleteApiUsageInspectionTest : ObsoleteApiUsageInspectionTestBase() {
|
|
fun `test direct usage`() {
|
|
myFixture.testHighlighting(JvmLanguage.KOTLIN, """
|
|
class B {
|
|
fun f(a: A) {
|
|
a.<warning descr="Obsolete API is used">f</warning>();
|
|
}
|
|
}
|
|
""".trimIndent())
|
|
}
|
|
|
|
fun `test override`() {
|
|
myFixture.testHighlighting(JvmLanguage.KOTLIN, """
|
|
class C : A() {
|
|
override fun <warning descr="Obsolete API is used">f</warning>() { }
|
|
}
|
|
|
|
@org.jetbrains.annotations.ApiStatus.Obsolete
|
|
class D : A() {
|
|
override fun <warning descr="Obsolete API is used">f</warning>() { }
|
|
}
|
|
""".trimIndent())
|
|
}
|
|
|
|
fun `test generic reference`() {
|
|
myFixture.addClass("@org.jetbrains.annotations.ApiStatus.Obsolete public interface I<T> {}")
|
|
myFixture.testHighlighting(JvmLanguage.KOTLIN, """
|
|
class U {
|
|
fun u(i: <warning descr="Obsolete API is used">I</warning><Int>) = i
|
|
}
|
|
""".trimIndent())
|
|
}
|
|
} |