-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Labels
QuestionSupport request issue typeSupport request issue typeS: waiting for clarificationStatus: additional information required to proceedStatus: additional information required to proceed
Description
When using when, there are always extra branches that prevent you from achieving 100% coverage.
Example 1:
private fun replaceGuid(guid: String): String {
return when (guid) {
"11" -> "11"
"22" -> "22"
"33" -> "33"
else -> guid
}
}
Intellij Coverage Plugin and Kover show 9 branches.
Example 2:
private fun replaceGuid(guid: String): String {
if (guid == "11"){
return "11"
}
if (guid == "22"){
return "22"
}
if (guid == "33"){
return "33"
}
return guid
}
Intellij Coverage Plugin and Kover show 4 branches.
Is there any way to fix this without changing the code of the class being tested or modifying the bytecode?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
QuestionSupport request issue typeSupport request issue typeS: waiting for clarificationStatus: additional information required to proceedStatus: additional information required to proceed