Skip to content

Commit

Permalink
Add test for @JvmInline value class
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonMarquis committed Dec 18, 2022
1 parent c620075 commit da5ccce
Showing 1 changed file with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,35 @@ class MockkUnnecessaryUsageDetectorTest {
)
}

@Test
fun expectWarningsForValueClass(): Unit = with(ISSUE_PRIMITIVE) {
lint().allowMissingSdk()
.files(
kotlin(
"""
import io.mockk.mockk
@JvmInline
value class Password(private val p: String)
val password = mockk<Password>()
""",
).indented(),
MOCKK_STUB,
)
.issues(this)
.run()
.expectWarningCount(1)
.expectContains(
"""
src/Password.kt:6: $severity: $explanation [$id]
val password = mockk<Password>()
~~~~~~~~~~~~~~~~~
0 errors, 1 warnings
""".trimIndent(),
)
}

@Test
fun expectClean() {
lint().allowMissingSdk()
Expand Down

0 comments on commit da5ccce

Please sign in to comment.