Kotlin / kotlinx-kover

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Objects with only consts are not covered

skmpowdjy opened this issue · comments

Given an object that only contains consts, e.g.

object Constants {
    const val TEST_STRING = "test"
}

The Constants object will be marked as not covered, even though their consts are all accessed in code under test, via Constants.TEST_STRING, etc.

Adding a function to the object and calling the function in a test, however, results in full coverage for the object.

This is with plugin version 0.7.3

Hi,
access to constants is not tracked individually, Kover registers the use of the object instance itself (its init method execution).

Duplicates #451