Skip to content

Commit 03176c7

Browse files
committed
Recover proper coverage filtering and add few more tests for legacy selects
1 parent feea6a5 commit 03176c7

File tree

2 files changed

+34
-6
lines changed

2 files changed

+34
-6
lines changed

kotlinx-coroutines-core/build.gradle

+6-6
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ def commonKoverExcludes =
260260
"kotlinx.coroutines.scheduling.ExperimentalCoroutineDispatcher" // Deprecated
261261
]
262262

263-
tasks.koverHtmlReport {
264-
excludes = commonKoverExcludes
265-
}
266-
267-
tasks.koverVerify {
268-
excludes = commonKoverExcludes
263+
kover {
264+
filters {
265+
classes {
266+
excludes.addAll(commonKoverExcludes)
267+
}
268+
}
269269
}
270270

271271
task testsJar(type: Jar, dependsOn: jvmTestClasses) {

kotlinx-coroutines-core/common/test/selects/SelectOldTest.kt

+28
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,34 @@ class SelectOldTest : TestBase() {
9090
finish(8)
9191
}
9292

93+
@Test
94+
fun testSelectUnbiasedComplete() = runTest {
95+
expect(1)
96+
val job = Job()
97+
job.complete()
98+
expect(2)
99+
val res = selectUnbiasedOld<String> {
100+
job.onJoin {
101+
expect(3)
102+
"OK"
103+
}
104+
}
105+
assertEquals("OK", res)
106+
finish(4)
107+
}
108+
109+
@Test
110+
fun testSelectUnbiasedThrows() = runTest {
111+
try {
112+
select<Unit> {
113+
expect(1)
114+
throw TestException()
115+
}
116+
} catch (e: TestException) {
117+
finish(2)
118+
}
119+
}
120+
93121
@Test
94122
fun testSelectLazy() = runTest {
95123
expect(1)

0 commit comments

Comments
 (0)