Skip to content

Commit

Permalink
Fixed coverage evaluation for enum in K2
Browse files Browse the repository at this point in the history
Fixes #621
  • Loading branch information
shanshin committed Jun 11, 2024
1 parent 841f13f commit da42d0e
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]

intellij-coverage = "1.0.754"
intellij-coverage = "1.0.755"
junit = "5.9.0"
kotlinx-bcv = "0.13.2"
kotlinx-dokka = "1.8.10"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,13 @@ internal class CountersValueTests {
methodCounter("org.jetbrains.Different", "helloWorld").assertTotal(4)
}
}

@TemplateTest("k2-counters", ["koverXmlReport"])
fun CheckerContext.testK2() {
xmlReport {
// test enums
classCounter("org.jetbrains.K2Enum", type = "LINE").assertFullyCovered()
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
plugins {
kotlin("jvm") version "2.0.0"
id("org.jetbrains.kotlinx.kover")
}

dependencies {
testImplementation(kotlin("test"))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}

rootProject.name = "k2-counters"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.jetbrains

enum class K2Enum {
A,
B
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.jetbrains.serialuser

import org.jetbrains.*
import kotlin.test.Test

class TestClass {
@Test
fun testBranches() {
println(K2Enum.A)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public object KoverVersions {
/**
* Kover coverage tool version.
*/
public const val KOVER_TOOL_VERSION = "1.0.754"
public const val KOVER_TOOL_VERSION = "1.0.755"

/**
* JaCoCo coverage tool version used by default.
Expand Down

0 comments on commit da42d0e

Please sign in to comment.