mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[junit5 inspection] add tests for malformed parameterized class method source IJ-CR-166493
GitOrigin-RevId: 541dacb7a76e0af153c253f4a70475c070d311a9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fa40715975
commit
92db15dcb3
+17
@@ -650,6 +650,23 @@ class JavaJUnitMalformedDeclarationInspectionTest {
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
fun `test malformed parameterized class method source should not be static highlighting`() {
|
||||
myFixture.testHighlighting(JvmLanguage.JAVA, """
|
||||
@org.junit.jupiter.params.ParameterizedClass
|
||||
@org.junit.jupiter.params.provider.MethodSource("a")
|
||||
@org.junit.jupiter.api.TestInstance(org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS)
|
||||
class TestMethodSource {
|
||||
@org.junit.jupiter.params.Parameter
|
||||
String param;
|
||||
|
||||
@org.junit.jupiter.api.Test
|
||||
void test() { }
|
||||
|
||||
String[] a() { return new String[] {"a", "b"}; }
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
fun `test malformed parameterized class method source should have no parameters highlighting`() {
|
||||
myFixture.testHighlighting(JvmLanguage.JAVA, """
|
||||
@org.junit.jupiter.params.ParameterizedClass
|
||||
|
||||
+18
@@ -543,6 +543,24 @@ abstract class KotlinJUnitMalformedDeclarationInspectionTestLatest : KotlinJUnit
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
fun `test malformed parameterized class method source should not be static`() {
|
||||
myFixture.testHighlighting(
|
||||
JvmLanguage.KOTLIN, """
|
||||
@org.junit.jupiter.params.ParameterizedClass
|
||||
@org.junit.jupiter.params.provider.MethodSource("a")
|
||||
@org.junit.jupiter.api.TestInstance(org.junit.jupiter.api.TestInstance.Lifecycle.PER_CLASS)
|
||||
class TestMethodSource {
|
||||
@org.junit.jupiter.params.Parameter
|
||||
lateinit var param: String
|
||||
|
||||
@org.junit.jupiter.api.Test
|
||||
fun test() { }
|
||||
|
||||
fun a(): Array<String> { return arrayOf("a", "b") }
|
||||
}
|
||||
""".trimIndent())
|
||||
}
|
||||
|
||||
/* Malformed parameterized */
|
||||
fun `test malformed parameterized @ValueSourcesTest no highlighting`() {
|
||||
myFixture.testHighlighting(JvmLanguage.KOTLIN, """
|
||||
|
||||
Reference in New Issue
Block a user