Skip to content

Commit 1145514

Browse files
committed
Remove some ExperimentalCoroutinesApi markers in the test module
1 parent 9fd86bb commit 1145514

File tree

5 files changed

+0
-15
lines changed

5 files changed

+0
-15
lines changed

kotlinx-coroutines-test/common/src/TestBuilders.kt

-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import kotlin.time.Duration.Companion.seconds
3131
* * Don't nest functions returning a [TestResult].
3232
*/
3333
@Suppress("NO_ACTUAL_FOR_EXPECT")
34-
@ExperimentalCoroutinesApi
3534
public expect class TestResult
3635

3736
/**
@@ -153,7 +152,6 @@ public expect class TestResult
153152
*
154153
* @throws IllegalArgumentException if the [context] is invalid. See the [TestScope] constructor docs for details.
155154
*/
156-
@ExperimentalCoroutinesApi
157155
public fun runTest(
158156
context: CoroutineContext = EmptyCoroutineContext,
159157
timeout: Duration = DEFAULT_TIMEOUT,
@@ -298,7 +296,6 @@ public fun runTest(
298296
/**
299297
* Performs [runTest] on an existing [TestScope]. See the documentation for [runTest] for details.
300298
*/
301-
@ExperimentalCoroutinesApi
302299
public fun TestScope.runTest(
303300
timeout: Duration = DEFAULT_TIMEOUT,
304301
testBody: suspend TestScope.() -> Unit

kotlinx-coroutines-test/common/src/TestCoroutineDispatchers.kt

-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ private class UnconfinedTestDispatcherImpl(
137137
*
138138
* @see UnconfinedTestDispatcher for a dispatcher that is not confined to any particular thread.
139139
*/
140-
@ExperimentalCoroutinesApi
141140
@Suppress("FunctionName")
142141
public fun StandardTestDispatcher(
143142
scheduler: TestCoroutineScheduler? = null,

kotlinx-coroutines-test/common/src/TestCoroutineScheduler.kt

-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import kotlin.time.Duration.Companion.milliseconds
2727
* virtual time as needed (via [advanceUntilIdle]), or run the tasks that are scheduled to run as soon as possible but
2828
* haven't yet been dispatched (via [runCurrent]).
2929
*/
30-
@ExperimentalCoroutinesApi
3130
public class TestCoroutineScheduler : AbstractCoroutineContextElement(TestCoroutineScheduler),
3231
CoroutineContext.Element {
3332

@@ -113,7 +112,6 @@ public class TestCoroutineScheduler : AbstractCoroutineContextElement(TestCorout
113112
* milliseconds by which the execution of this method has advanced the virtual time. If you want to recreate that
114113
* functionality, query [currentTime] before and after the execution to achieve the same result.
115114
*/
116-
@ExperimentalCoroutinesApi
117115
public fun advanceUntilIdle(): Unit = advanceUntilIdleOr { events.none(TestDispatchEvent<*>::isForeground) }
118116

119117
/**
@@ -129,7 +127,6 @@ public class TestCoroutineScheduler : AbstractCoroutineContextElement(TestCorout
129127
/**
130128
* Runs the tasks that are scheduled to execute at this moment of virtual time.
131129
*/
132-
@ExperimentalCoroutinesApi
133130
public fun runCurrent() {
134131
val timeMark = synchronized(lock) { currentTime }
135132
while (true) {
@@ -165,7 +162,6 @@ public class TestCoroutineScheduler : AbstractCoroutineContextElement(TestCorout
165162
*
166163
* @throws IllegalArgumentException if passed a negative [delay][delayTime].
167164
*/
168-
@ExperimentalCoroutinesApi
169165
public fun advanceTimeBy(delayTime: Duration) {
170166
require(!delayTime.isNegative()) { "Can not advance time by a negative delay: $delayTime" }
171167
val startingTime = currentTime
@@ -222,7 +218,6 @@ public class TestCoroutineScheduler : AbstractCoroutineContextElement(TestCorout
222218
/**
223219
* Returns the [TimeSource] representation of the virtual time of this scheduler.
224220
*/
225-
@ExperimentalCoroutinesApi
226221
@ExperimentalTime
227222
public val timeSource: TimeSource = object : AbstractLongTimeSource(DurationUnit.MILLISECONDS) {
228223
override fun read(): Long = currentTime

kotlinx-coroutines-test/common/src/TestDispatcher.kt

-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ import kotlin.jvm.*
1616
* * [UnconfinedTestDispatcher] is a dispatcher that behaves like [Dispatchers.Unconfined] while allowing to control
1717
* the virtual time.
1818
*/
19-
@ExperimentalCoroutinesApi
2019
public abstract class TestDispatcher internal constructor() : CoroutineDispatcher(), Delay {
2120
/** The scheduler that this dispatcher is linked to. */
22-
@ExperimentalCoroutinesApi
2321
public abstract val scheduler: TestCoroutineScheduler
2422

2523
/** Notifies the dispatcher that it should process a single event marked with [marker] happening at time [time]. */

kotlinx-coroutines-test/common/src/TestScope.kt

-4
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,10 @@ import kotlin.time.*
4040
* paused by default, like [StandardTestDispatcher].
4141
* * No access to the list of unhandled exceptions.
4242
*/
43-
@ExperimentalCoroutinesApi
4443
public sealed interface TestScope : CoroutineScope {
4544
/**
4645
* The delay-skipping scheduler used by the test dispatchers running the code in this scope.
4746
*/
48-
@ExperimentalCoroutinesApi
4947
public val testScheduler: TestCoroutineScheduler
5048

5149
/**
@@ -82,7 +80,6 @@ public sealed interface TestScope : CoroutineScope {
8280
* }
8381
* ```
8482
*/
85-
@ExperimentalCoroutinesApi
8683
public val backgroundScope: CoroutineScope
8784
}
8885

@@ -166,7 +163,6 @@ public val TestScope.testTimeSource: TimeSource get() = testScheduler.timeSource
166163
* @throws IllegalArgumentException if [context] has an [CoroutineExceptionHandler] that is not an
167164
* [UncaughtExceptionCaptor].
168165
*/
169-
@ExperimentalCoroutinesApi
170166
@Suppress("FunctionName")
171167
public fun TestScope(context: CoroutineContext = EmptyCoroutineContext): TestScope {
172168
val ctxWithDispatcher = context.withDelaySkipping()

0 commit comments

Comments
 (0)