Skip to content

Commit 97d0f47

Browse files
committed
Fixes
1 parent ae82754 commit 97d0f47

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public expect class TestResult
5555
* immediately return the produced [TestResult] from the test method, without doing anything else afterwards. See
5656
* [TestResult] for details on this.
5757
*
58-
* The test is run in a single thread, unless other [ContinuationInterceptor] are used for child coroutines.
58+
* The test is run in a single thread, unless other [CoroutineDispatcher] are used for child coroutines.
5959
* Because of this, child coroutines are not executed in parallel to the test body.
6060
* In order to for the spawned-off asynchronous code to actually be executed, one must either [yield] or suspend the
6161
* test body some other way, or use commands that control scheduling (see [TestCoroutineScheduler]).

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ private class UnconfinedTestDispatcherImpl(
137137
*
138138
* @see UnconfinedTestDispatcher for a dispatcher that is not confined to any particular thread.
139139
*/
140+
@ExperimentalCoroutinesApi
140141
@Suppress("FunctionName")
141142
public fun StandardTestDispatcher(
142143
scheduler: TestCoroutineScheduler? = null,
@@ -155,4 +156,4 @@ private class StandardTestDispatcherImpl(
155156
}
156157

157158
override fun toString(): String = "${name ?: "StandardTestDispatcher"}[scheduler=$scheduler]"
158-
}
159+
}

kotlinx-coroutines-test/common/src/internal/TestMainDispatcher.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ internal class TestMainDispatcher(delegate: CoroutineDispatcher):
6060
* The read operations never throw. Instead, the failures detected inside them will be remembered and thrown on the
6161
* next modification.
6262
*/
63-
private class NonConcurrentlyModifiable<T>(private val initialValue: T, private val name: String) {
63+
private class NonConcurrentlyModifiable<T>(initialValue: T, private val name: String) {
6464
private val readers = atomic(0) // number of concurrent readers
6565
private val isWriting = atomic(false) // a modification is happening currently
6666
private val exceptionWhenReading: AtomicRef<Throwable?> = atomic(null) // exception from reading
@@ -77,7 +77,7 @@ internal class TestMainDispatcher(delegate: CoroutineDispatcher):
7777
readers.decrementAndGet()
7878
return result
7979
}
80-
set(value: T) {
80+
set(value) {
8181
exceptionWhenReading.getAndSet(null)?.let { throw it }
8282
if (readers.value != 0) throw concurrentRW()
8383
if (!isWriting.compareAndSet(expect = false, update = true)) throw concurrentWW()
@@ -93,4 +93,4 @@ private val defaultDelay
9393
inline get() = DefaultDelay
9494

9595
@Suppress("INVISIBLE_MEMBER")
96-
internal expect fun Dispatchers.getTestMainDispatcher(): TestMainDispatcher
96+
internal expect fun Dispatchers.getTestMainDispatcher(): TestMainDispatcher

0 commit comments

Comments
 (0)