@@ -10,7 +10,7 @@ import org.junit.Ignore
1010
1111
1212public class ObservablesTest {
13- test fun testCreation () {
13+ @ test fun testCreation () {
1414 val o0 : Observable <Int > = emptyObservable()
1515 observable<Int > { s -> s.onNext(1 ); s.onNext(777 ); s.onCompleted() }.toList().forEach {
1616 assertEquals(listOf (1 , 777 ), it)
@@ -30,7 +30,7 @@ public class ObservablesTest {
3030 assertNotNull(o5)
3131 }
3232
33- test fun testExampleFromReadme () {
33+ @ test fun testExampleFromReadme () {
3434 val result = observable<String > { subscriber ->
3535 subscriber.onNext(" H" )
3636 subscriber.onNext(" e" )
@@ -47,39 +47,39 @@ public class ObservablesTest {
4747 assertEquals(" Hello" , result)
4848 }
4949
50- test fun iteratorObservable () {
50+ @ test fun iteratorObservable () {
5151 assertEquals(listOf (1 ,2 ,3 ), listOf (1 ,2 ,3 ).iterator().toObservable().toList().toBlocking().single())
5252 }
5353
54- test fun intProgressionStep1Empty () {
54+ @ test fun intProgressionStep1Empty () {
5555 assertEquals(listOf (1 ), (1 .. 1 ).toObservable().toList().toBlocking().first())
5656 }
57- test fun intProgressionStep1 () {
57+ @ test fun intProgressionStep1 () {
5858 assertEquals((1 .. 10 ).toList(), (1 .. 10 ).toObservable().toList().toBlocking().first())
5959 }
6060
61- test fun intProgressionDownto () {
61+ @ test fun intProgressionDownto () {
6262 assertEquals((1 downTo 10 ).toList(), (1 downTo 10 ).toObservable().toList().toBlocking().first())
6363 }
6464
65- Ignore
66- test fun intProgressionOverflow () {
65+ @ Ignore
66+ @ test fun intProgressionOverflow () {
6767 // too slow
68- assertEquals((0 .. 10 ).toList().reverse (), (- 10 .. Integer .MAX_VALUE ).toObservable().skip(Integer .MAX_VALUE ).map{Integer .MAX_VALUE - it}.toList().toBlocking().first())
68+ assertEquals((0 .. 10 ).toList().reversed (), (- 10 .. Integer .MAX_VALUE ).toObservable().skip(Integer .MAX_VALUE ).map{Integer .MAX_VALUE - it}.toList().toBlocking().first())
6969 }
7070
71- test fun filterNotNull () {
71+ @ test fun filterNotNull () {
7272 val o : Observable <Int > = listOf (1 , null ).toObservable().filterNotNull()
7373 o.toList().forEach {
7474 assertEquals(listOf (1 ), it)
7575 }
7676 }
7777
78- test fun requireNoNullsWithoutNulls () {
78+ @ test fun requireNoNullsWithoutNulls () {
7979 (listOf (1 ,2 ) as List <Int ?>).toObservable().requireNoNulls().subscribe()
8080 }
8181
82- test fun requireNoNulls () {
82+ @ test fun requireNoNulls () {
8383 try {
8484 val o : Observable <Int > = listOf (1 , null ).toObservable().requireNoNulls()
8585
@@ -89,7 +89,7 @@ public class ObservablesTest {
8989 }
9090 }
9191
92- test fun testWithIndex () {
92+ @ test fun testWithIndex () {
9393 listOf (" a" , " b" , " c" ).toObservable().
9494 withIndex().
9595 toList().
@@ -98,29 +98,29 @@ public class ObservablesTest {
9898 }
9999 }
100100
101- test fun testFold () {
101+ @ test fun testFold () {
102102 listOf (1 , 2 , 3 ).toObservable().fold(0 ) {acc, e -> acc + e}.single().forEach {
103103 assertEquals(6 , it)
104104 }
105105 }
106106
107- test fun `kotlin sequence should produce expected items and observable be able to handle em` () {
107+ @ test fun `kotlin sequence should produce expected items and observable be able to handle em` () {
108108 kotlin.sequence(0 ) {it + 1 }.toObservable().take(3 ).toList().forEach {
109109 assertEquals(listOf (0 , 1 , 2 ), it)
110110 }
111111 }
112112
113- test fun `infinite iterable should not hang or produce too many elements` () {
113+ @ test fun `infinite iterable should not hang or produce too many elements` () {
114114 val generated = AtomicInteger ()
115115 kotlin.sequence { generated.incrementAndGet() }.toObservable().
116116 take(100 ).
117117 toList().
118118 subscribe()
119119
120- assertEquals(101 , generated.get())
120+ assertEquals(100 , generated.get())
121121 }
122122
123- test fun testFlatMapSequence () {
123+ @ test fun testFlatMapSequence () {
124124 assertEquals(
125125 listOf (1 , 2 , 3 , 2 , 3 , 4 , 3 , 4 , 5 ),
126126 listOf (1 ,2 ,3 ).toObservable().flatMapSequence { listOf (it, it + 1 , it + 2 ).asSequence() }.toList().toBlocking().single()
0 commit comments