Skip to content

Commit

Permalink
Fix build on Native
Browse files Browse the repository at this point in the history
  • Loading branch information
dkhalanskyjb committed Nov 17, 2021
1 parent 58e508a commit ae82754
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
Expand Up @@ -64,6 +64,7 @@ class StandardTestDispatcherTest: OrderedExecutionTestBase() {

/** Tests that the [TestCoroutineScheduler] used for [Dispatchers.Main] gets used by default. */
@Test
@NoNative
fun testSchedulerReuse() {
val dispatcher1 = StandardTestDispatcher()
Dispatchers.setMain(dispatcher1)
Expand Down
3 changes: 2 additions & 1 deletion kotlinx-coroutines-test/common/test/TestDispatchersTest.kt
Expand Up @@ -8,6 +8,7 @@ import kotlinx.coroutines.test.internal.*
import kotlin.coroutines.*
import kotlin.test.*

@NoNative
class TestDispatchersTest: OrderedExecutionTestBase() {

@BeforeTest
Expand All @@ -21,8 +22,8 @@ class TestDispatchersTest: OrderedExecutionTestBase() {
}

/** Tests that asynchronous execution of tests does not happen concurrently with [AfterTest]. */
@NoJs
@Test
@NoJs
fun testMainMocking() = runTest {
val mainAtStart = TestMainDispatcher.currentTestDispatcher
assertNotNull(mainAtStart)
Expand Down
6 changes: 6 additions & 0 deletions kotlinx-coroutines-test/common/test/TestScopeTest.kt
Expand Up @@ -48,6 +48,12 @@ class TestScopeTest {
assertSame(scheduler, scope.coroutineContext[TestCoroutineScheduler])
assertSame(dispatcher, scope.coroutineContext[ContinuationInterceptor])
}
}

/** Part of [testCreateProvidesScheduler], disabled for Native */
@Test
@NoNative
fun testCreateReusesScheduler() {
// Reuses the scheduler of `Dispatchers.Main`
run {
val scheduler = TestCoroutineScheduler()
Expand Down
Expand Up @@ -153,6 +153,7 @@ class UnconfinedTestDispatcherTest {

/** Tests that the [TestCoroutineScheduler] used for [Dispatchers.Main] gets used by default. */
@Test
@NoNative
fun testSchedulerReuse() {
val dispatcher1 = StandardTestDispatcher()
Dispatchers.setMain(dispatcher1)
Expand Down

0 comments on commit ae82754

Please sign in to comment.