Skip to content

Commit

Permalink
Cleanup CombineParametersTestBase
Browse files Browse the repository at this point in the history
  • Loading branch information
qwwdfsad committed Oct 28, 2019
1 parent 2ba1d98 commit 1a2707b
Showing 1 changed file with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ class CombineParametersTest : TestBase() {
}

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

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

@Test
fun testEmpty() = runTest {
val value = combineTransform { args: Array<Int> ->
fun testTransformEmptyIterable() = runTest {
val value = combineTransform(emptyList()) { args: Array<Int> ->
emit(args[0] + args[1])
}.singleOrNull()
assertNull(value)
}

@Test
fun testEmptyIterable() = runTest {
val value = combineTransform(emptyList()) { args: Array<Int> ->
fun testTransformEmptyVararg() = runTest {
val value = combineTransform { args: Array<Int> ->
emit(args[0] + args[1])
}.singleOrNull()
assertNull(value)
}

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

@Test
fun testEmptyIterableReified() = runTest {
val value = combineTransform(emptyList()) { args: Array<Int> ->
emit(args[0] + args[1])
fun testEmptyVararg() = runTest {
val value = combine { args: Array<Int> ->
args[0] + args[1]
}.singleOrNull()
assertNull(value)
}
Expand Down

0 comments on commit 1a2707b

Please sign in to comment.