Skip to content

Commit

Permalink
Recover proper coverage filtering and add few more tests for legacy s…
Browse files Browse the repository at this point in the history
…elects
  • Loading branch information
qwwdfsad committed Aug 4, 2022
1 parent feea6a5 commit 03176c7
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
12 changes: 6 additions & 6 deletions kotlinx-coroutines-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ def commonKoverExcludes =
"kotlinx.coroutines.scheduling.ExperimentalCoroutineDispatcher" // Deprecated
]

tasks.koverHtmlReport {
excludes = commonKoverExcludes
}

tasks.koverVerify {
excludes = commonKoverExcludes
kover {
filters {
classes {
excludes.addAll(commonKoverExcludes)
}
}
}

task testsJar(type: Jar, dependsOn: jvmTestClasses) {
Expand Down
28 changes: 28 additions & 0 deletions kotlinx-coroutines-core/common/test/selects/SelectOldTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,34 @@ class SelectOldTest : TestBase() {
finish(8)
}

@Test
fun testSelectUnbiasedComplete() = runTest {
expect(1)
val job = Job()
job.complete()
expect(2)
val res = selectUnbiasedOld<String> {
job.onJoin {
expect(3)
"OK"
}
}
assertEquals("OK", res)
finish(4)
}

@Test
fun testSelectUnbiasedThrows() = runTest {
try {
select<Unit> {
expect(1)
throw TestException()
}
} catch (e: TestException) {
finish(2)
}
}

@Test
fun testSelectLazy() = runTest {
expect(1)
Expand Down

0 comments on commit 03176c7

Please sign in to comment.