Add Konsist test on Immutable annotation

This commit is contained in:
Benoit Marty 2025-10-09 15:36:06 +02:00
parent 6991640886
commit f9ba0819f2
3 changed files with 15 additions and 5 deletions

View file

@ -7,8 +7,12 @@
package io.element.android.tests.konsist
import androidx.compose.runtime.Immutable
import com.lemonappdev.konsist.api.Konsist
import com.lemonappdev.konsist.api.ext.list.withAnnotationOf
import com.lemonappdev.konsist.api.ext.list.withNameEndingWith
import com.lemonappdev.konsist.api.ext.list.withoutName
import com.lemonappdev.konsist.api.verify.assertEmpty
import com.lemonappdev.konsist.api.verify.assertFalse
import org.junit.Test
@ -60,4 +64,14 @@ class KonsistImmutableTest {
it.text.contains(".toPersistentMap()")
}
}
@Test
fun `Immutable annotation is not used on sealed interface for Presenter Events`() {
Konsist
.scopeFromProduction()
.interfaces()
.withNameEndingWith("Events")
.withAnnotationOf(Immutable::class)
.assertEmpty()
}
}