For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generic Types Test Snippets

1. All Generic Return Types Contain X In Their Name

@Test
fun `all generic return types contain X in their name`() {
    Konsist
        .scopeFromProduction()
        .functions()
        .returnTypes
        .withGeneric()
        .assertTrue { it.hasNameContaining("X") }
}

2. Property Generic Type Does Not Contain Star Projection

@Test
fun `property generic type does not contain star projection`() {
    Konsist
        .scopeFromProduction()
        .properties()
        .types
        .assertFalse { type ->
            type
                .typeArguments
                .flatten()
                .any { it.isStarProjection }
        }
}

3. All Generic Return Types Contain Kotlin Collection Type Argument

4. Function Parameter Has No Generic Type Argument With Name Ending With Repository

Last updated