Skip to content

Commit 44927b6

Browse files
committed
Remove the public from test source sets
Command was: git grep -l '^ *public ' | grep /test/ | xargs sed -i 's/^\( *\)public /\1/g'
1 parent 3591801 commit 44927b6

28 files changed

+68
-68
lines changed

kotlinx-coroutines-core/common/test/flow/NamedDispatchers.kt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import kotlin.coroutines.*
55
/**
66
* Test dispatchers that emulate multiplatform context tracking.
77
*/
8-
public object NamedDispatchers {
8+
object NamedDispatchers {
99

1010
private val stack = ArrayStack()
1111

12-
public fun name(): String = stack.peek() ?: error("No names on stack")
12+
fun name(): String = stack.peek() ?: error("No names on stack")
1313

14-
public fun nameOr(defaultValue: String): String = stack.peek() ?: defaultValue
14+
fun nameOr(defaultValue: String): String = stack.peek() ?: defaultValue
1515

16-
public operator fun invoke(name: String) = named(name)
16+
operator fun invoke(name: String) = named(name)
1717

1818
private fun named(name: String): CoroutineDispatcher = object : CoroutineDispatcher() {
1919
override fun dispatch(context: CoroutineContext, block: Runnable) {
@@ -32,14 +32,14 @@ private class ArrayStack {
3232
private var elements = arrayOfNulls<String>(16)
3333
private var head = 0
3434

35-
public fun push(value: String) {
35+
fun push(value: String) {
3636
if (elements.size == head - 1) ensureCapacity()
3737
elements[head++] = value
3838
}
3939

40-
public fun peek(): String? = elements.getOrNull(head - 1)
40+
fun peek(): String? = elements.getOrNull(head - 1)
4141

42-
public fun pop(): String? {
42+
fun pop(): String? {
4343
if (head == 0) return null
4444
return elements[--head]
4545
}

kotlinx-coroutines-core/common/test/flow/VirtualTime.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ internal class VirtualTimeDispatcher(enclosingScope: CoroutineScope) : Coroutine
8989
* return from [withVirtualTime] before the test is executed completely.
9090
* To decrease the probability of such error, additional `finish` constraint is added.
9191
*/
92-
public fun TestBase.withVirtualTime(block: suspend CoroutineScope.() -> Unit) = runTest {
92+
fun TestBase.withVirtualTime(block: suspend CoroutineScope.() -> Unit) = runTest {
9393
withContext(Dispatchers.Unconfined) {
9494
// Create a platform-independent event loop
9595
val dispatcher = VirtualTimeDispatcher(this)

kotlinx-coroutines-core/common/test/flow/operators/FlowOnTest.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class FlowOnTest : TestBase() {
5555
}
5656

5757
@Test
58-
public fun testFlowOnThrowingSource() = runTest {
58+
fun testFlowOnThrowingSource() = runTest {
5959
val flow = flow {
6060
expect(1)
6161
emit(NamedDispatchers.name())
@@ -73,7 +73,7 @@ class FlowOnTest : TestBase() {
7373
}
7474

7575
@Test
76-
public fun testFlowOnThrowingOperator() = runTest {
76+
fun testFlowOnThrowingOperator() = runTest {
7777
val flow = flow {
7878
expect(1)
7979
emit(NamedDispatchers.name())
@@ -90,7 +90,7 @@ class FlowOnTest : TestBase() {
9090
}
9191

9292
@Test
93-
public fun testFlowOnDownstreamOperator() = runTest() {
93+
fun testFlowOnDownstreamOperator() = runTest() {
9494
val flow = flow {
9595
expect(2)
9696
emit(NamedDispatchers.name())
@@ -112,7 +112,7 @@ class FlowOnTest : TestBase() {
112112
}
113113

114114
@Test
115-
public fun testFlowOnThrowingConsumer() = runTest {
115+
fun testFlowOnThrowingConsumer() = runTest {
116116
val flow = flow {
117117
expect(2)
118118
emit(NamedDispatchers.name())
@@ -323,7 +323,7 @@ class FlowOnTest : TestBase() {
323323
}
324324

325325
private inner class Source(private val value: Int) {
326-
public var contextName: String = "unknown"
326+
var contextName: String = "unknown"
327327

328328
fun produce(): Int {
329329
contextName = NamedDispatchers.nameOr("main")
@@ -332,7 +332,7 @@ class FlowOnTest : TestBase() {
332332
}
333333

334334
private inner class Consumer(private val expected: Int) {
335-
public var contextName: String = "unknown"
335+
var contextName: String = "unknown"
336336

337337
fun consume(value: Int) {
338338
contextName = NamedDispatchers.nameOr("main")

kotlinx-coroutines-core/common/test/flow/operators/SampleTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import kotlin.time.Duration.Companion.milliseconds
99

1010
class SampleTest : TestBase() {
1111
@Test
12-
public fun testBasic() = withVirtualTime {
12+
fun testBasic() = withVirtualTime {
1313
expect(1)
1414
val flow = flow {
1515
expect(3)

kotlinx-coroutines-core/common/test/flow/sharing/SharedFlowTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ class SharedFlowTest : TestBase() {
558558
}
559559

560560
@Test
561-
public fun testOnSubscription() = runTest {
561+
fun testOnSubscription() = runTest {
562562
expect(1)
563563
val sh = MutableSharedFlow<String>()
564564
fun share(s: String) { launch(start = CoroutineStart.UNDISPATCHED) { sh.emit(s) } }
@@ -762,10 +762,10 @@ class SharedFlowTest : TestBase() {
762762
}
763763

764764
@Test
765-
public fun testReplayCancellability() = testCancellability(fromReplay = true)
765+
fun testReplayCancellability() = testCancellability(fromReplay = true)
766766

767767
@Test
768-
public fun testEmitCancellability() = testCancellability(fromReplay = false)
768+
fun testEmitCancellability() = testCancellability(fromReplay = false)
769769

770770
private fun testCancellability(fromReplay: Boolean) = runTest {
771771
expect(1)

kotlinx-coroutines-core/common/test/flow/sharing/StateFlowTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class StateFlowTest : TestBase() {
172172
}
173173

174174
@Test
175-
public fun testOnSubscriptionWithException() = runTest {
175+
fun testOnSubscriptionWithException() = runTest {
176176
expect(1)
177177
val state = MutableStateFlow("A")
178178
state

kotlinx-coroutines-core/concurrent/test/AbstractDispatcherConcurrencyTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import kotlin.test.*
77

88
abstract class AbstractDispatcherConcurrencyTest : TestBase() {
99

10-
public abstract val dispatcher: CoroutineDispatcher
10+
abstract val dispatcher: CoroutineDispatcher
1111

1212
@Test
1313
fun testLaunchAndJoin() = runTest {

kotlinx-coroutines-core/jvm/test/AwaitJvmTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.junit.*
55

66
class AwaitJvmTest : TestBase() {
77
@Test
8-
public fun testSecondLeak() = runTest {
8+
fun testSecondLeak() = runTest {
99
// This test is to make sure that handlers installed on the second deferred do not leak
1010
val d1 = CompletableDeferred<Int>()
1111
val d2 = CompletableDeferred<Int>()

kotlinx-coroutines-core/jvm/test/AwaitStressTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class AwaitStressTest : TestBase() {
99

1010
private val iterations = 50_000 * stressTestMultiplier
1111
@get:Rule
12-
public val pool = ExecutorRule(4)
12+
val pool = ExecutorRule(4)
1313

1414
@Test
1515
fun testMultipleExceptions() = runTest {

kotlinx-coroutines-core/jvm/test/CancellableContinuationJvmTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ class CancellableContinuationJvmTest : TestBase() {
6363
private var isCancelled = false
6464

6565
@Volatile
66-
public var hasSubscriber = false
66+
var hasSubscriber = false
6767

68-
public fun subscribe() {
68+
fun subscribe() {
6969
hasSubscriber = true
7070
while (!isCancelled) {
7171
Thread.sleep(10)
7272
}
7373
}
7474

75-
public fun cancel() {
75+
fun cancel() {
7676
isCancelled = true
7777
}
7878
}

0 commit comments

Comments
 (0)