@@ -16,44 +16,44 @@ class CombineLatestTest : TestBase() {
16
16
fun testCombineLatest () = runTest {
17
17
val flow = flowOf(" a" , " b" , " c" )
18
18
val flow2 = flowOf(1 , 2 , 3 )
19
- val list = flow.combineLatest(flow2, { i, j -> i + j }) .toList()
19
+ val list = flow.combineLatest(flow2) { i, j -> i + j }.toList()
20
20
assertEquals(listOf (" a1" , " b1" , " b2" , " c2" , " c3" ), list)
21
21
}
22
22
23
23
@Test
24
24
fun testNulls () = runTest {
25
25
val flow = flowOf(" a" , null , null )
26
26
val flow2 = flowOf(1 , 2 , 3 )
27
- val list = flow.combineLatest(flow2, { i, j -> i + j }).toList()
27
+ val list = flow.combineLatest(flow2, { i, j -> i + j }).toList()
28
28
assertEquals(listOf (" a1" , " null1" , " null2" , " null2" , " null3" ), list)
29
29
}
30
30
31
31
@Test
32
32
fun testNullsOther () = runTest {
33
33
val flow = flowOf(" a" , " b" , " c" )
34
34
val flow2 = flowOf(null , 2 , null )
35
- val list = flow.combineLatest(flow2, { i, j -> i + j }).toList()
35
+ val list = flow.combineLatest(flow2, { i, j -> i + j }).toList()
36
36
assertEquals(listOf (" anull" , " bnull" , " b2" , " c2" , " cnull" ), list)
37
37
}
38
38
39
39
@Test
40
40
fun testEmptyFlow () = runTest {
41
- val flow = emptyFlow<String >().combineLatest(emptyFlow<Int >(), { i, j -> i + j })
41
+ val flow = emptyFlow<String >().combineLatest(emptyFlow<Int >(), { i, j -> i + j })
42
42
assertNull(flow.singleOrNull())
43
43
}
44
44
45
45
@Test
46
46
fun testFirstIsEmpty () = runTest {
47
47
val f1 = emptyFlow<String >()
48
48
val f2 = flowOf(1 )
49
- assertEquals(emptyList(), f1.combineLatest(f2, { i, j -> i + j }) .toList())
49
+ assertEquals(emptyList(), f1.combineLatest(f2) { i, j -> i + j }.toList())
50
50
}
51
51
52
52
@Test
53
53
fun testSecondIsEmpty () = runTest {
54
54
val f1 = flowOf(" a" )
55
55
val f2 = emptyFlow<Int >()
56
- assertEquals(emptyList(), f1.combineLatest(f2, { i, j -> i + j }) .toList())
56
+ assertEquals(emptyList(), f1.combineLatest(f2) { i, j -> i + j }.toList())
57
57
}
58
58
59
59
@Test
@@ -80,7 +80,7 @@ class CombineLatestTest : TestBase() {
80
80
emit(3 )
81
81
}
82
82
83
- val result = f1.combineLatest(f2, { i, j -> i + j }) .toList()
83
+ val result = f1.combineLatest(f2) { i, j -> i + j }.toList()
84
84
assertEquals(listOf (" a1" , " b1" , " c1" , " c2" , " c3" ), result)
85
85
finish(8 )
86
86
}
@@ -137,7 +137,7 @@ class CombineLatestTest : TestBase() {
137
137
}
138
138
}
139
139
140
- val value = withContext(NamedDispatchers (" main" )) {
140
+ val value = withContext(NamedDispatchers (" main" )) {
141
141
f1.combineLatest(f2) { i, j ->
142
142
assertEquals(" main" , NamedDispatchers .name())
143
143
expect(5 )
@@ -170,8 +170,8 @@ class CombineLatestTest : TestBase() {
170
170
expect(1 )
171
171
i + j
172
172
}.flowOn(NamedDispatchers (" combine" )).onEach {
173
- throw TestException ()
174
- }
173
+ throw TestException ()
174
+ }
175
175
176
176
assertFailsWith<TestException >(flow)
177
177
finish(4 )
0 commit comments