Skip to content

Commit 1a2707b

Browse files
committed
Cleanup CombineParametersTestBase
1 parent 2ba1d98 commit 1a2707b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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

+12-12
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ class CombineParametersTest : TestBase() {
9999
}
100100

101101
@Test
102-
fun testEmptyVararg() = runTest {
102+
fun testSingleVararg() = runTest {
103103
val list = combine(flowOf(1, 2, 3)) { args: Array<Any?> -> args[0] }.toList()
104104
assertEquals(listOf(1, 2, 3), list)
105105
}
106106

107107
@Test
108-
fun testEmptyVarargTransform() = runTest {
108+
fun testSingleVarargTransform() = runTest {
109109
val list = combineTransform(flowOf(1, 2, 3)) { args: Array<Any?> -> emit(args[0]) }.toList()
110110
assertEquals(listOf(1, 2, 3), list)
111111
}
@@ -131,33 +131,33 @@ class CombineParametersTest : TestBase() {
131131
}
132132

133133
@Test
134-
fun testEmpty() = runTest {
135-
val value = combineTransform { args: Array<Int> ->
134+
fun testTransformEmptyIterable() = runTest {
135+
val value = combineTransform(emptyList()) { args: Array<Int> ->
136136
emit(args[0] + args[1])
137137
}.singleOrNull()
138138
assertNull(value)
139139
}
140140

141141
@Test
142-
fun testEmptyIterable() = runTest {
143-
val value = combineTransform(emptyList()) { args: Array<Int> ->
142+
fun testTransformEmptyVararg() = runTest {
143+
val value = combineTransform { args: Array<Int> ->
144144
emit(args[0] + args[1])
145145
}.singleOrNull()
146146
assertNull(value)
147147
}
148148

149149
@Test
150-
fun testEmptyReified() = runTest {
151-
val value = combineTransform { args: Array<Int> ->
152-
emit(args[0] + args[1])
150+
fun testEmptyIterable() = runTest {
151+
val value = combine(emptyList()) { args: Array<Int> ->
152+
args[0] + args[1]
153153
}.singleOrNull()
154154
assertNull(value)
155155
}
156156

157157
@Test
158-
fun testEmptyIterableReified() = runTest {
159-
val value = combineTransform(emptyList()) { args: Array<Int> ->
160-
emit(args[0] + args[1])
158+
fun testEmptyVararg() = runTest {
159+
val value = combine { args: Array<Int> ->
160+
args[0] + args[1]
161161
}.singleOrNull()
162162
assertNull(value)
163163
}

0 commit comments

Comments
 (0)