mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[jvm] SerializableHasSerialVersionUidFieldInspection add Kotlin test
Adds test for when the companion object already exists. GitOrigin-RevId: da17be785a77d2440689505ed1d95f42c946d754
This commit is contained in:
committed by
intellij-monorepo-bot
parent
c13edb7af0
commit
b50acf3ee5
+21
@@ -30,4 +30,25 @@ class KotlinSerializableHasSerialVersionUidFieldInspectionTest : SerializableHas
|
||||
}
|
||||
""".trimIndent(), "Add 'serialVersionUID' field")
|
||||
}
|
||||
|
||||
fun `test quickfix companion exists`() {
|
||||
myFixture.testQuickFix(ULanguage.KOTLIN, """
|
||||
import java.io.Serializable
|
||||
|
||||
class Fo<caret>o : Serializable {
|
||||
companion object {
|
||||
val bar = 0
|
||||
}
|
||||
}
|
||||
""".trimIndent(), """
|
||||
import java.io.Serializable
|
||||
|
||||
class Foo : Serializable {
|
||||
companion object {
|
||||
private const val serialVersionUID: Long = -7315889077010185135L
|
||||
val bar = 0
|
||||
}
|
||||
}
|
||||
""".trimIndent(), "Add 'serialVersionUID' field")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user