-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Steps to reproduce
- JaCoCo version: 0.8.13.202504020838
- Operating system:
- Tool integration: Maven / Ant / CLI / API (for others please report to respective project)
- Complete executable reproducer: (e.g. GitHub Repo)
- Steps: (what exactly are you doing with the above reproducer?)
// The functions
package com.example.myapplication
fun addString(first: String, second: String): String {
return first + second
}
inline fun <reified T> add(first: T, second: T): String {
return first.toString() + second.toString()
}
inline fun inlineFun(inlined: () -> Unit, noinline notInlined: () -> Unit) {
inlined()
notInlined()
}// The tests
package com.example.myapplication
import io.mockk.mockk
import io.mockk.verifySequence
import org.junit.Assert.assertEquals
import org.junit.Test
class MyKtxKtTest {
@Test
fun `test addString`() {
assertEquals(addString("123", "789"), "123789")
}
@Test
fun `test add`() {
assertEquals(add<String>("1", "2"), "12")
}
@Test
fun `test inlineFun`() {
val mockInlined = mockk<() -> Unit>(relaxed = true)
val mockNotInlined = mockk<() -> Unit>(relaxed = true)
inlineFun(
inlined = mockInlined,
notInlined = mockNotInlined
)
verifySequence {
mockInlined()
mockNotInlined()
}
}
}Expected behaviour
- Coverage report should show 100% covered
Actual behaviour
- The report shows add() and inlineFun() are not covered with red highlight
(In case of exceptions provide FULL STACKTRACE)
zavedyaev and skaengus2012