Skip to content

Commit f85219a

Browse files
committed
Update CompletenessTest.scala for new operators
1 parent 720619c commit f85219a

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

language-adaptors/rxjava-scala/src/test/scala/rx/lang/scala/CompletenessTest.scala

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class CompletenessTest extends JUnitSuite {
4545
val commentForFirstWithPredicate = "[use `.filter(condition).first`]"
4646
val fromFuture = "[TODO: Decide how Scala Futures should relate to Observables. Should there be a " +
4747
"common base interface for Future and Observable? And should Futures also have an unsubscribe method?]"
48+
val commentForTakeLastBuffer = "[use `takeRight(...).toSeq`]"
4849

4950
/**
5051
* Maps each method from the Java Observable to its corresponding method in the Scala Observable
@@ -71,8 +72,14 @@ class CompletenessTest extends JUnitSuite {
7172
"all(Func1[_ >: T, Boolean])" -> "forall(T => Boolean)",
7273
"buffer(Long, Long, TimeUnit)" -> "buffer(Duration, Duration)",
7374
"buffer(Long, Long, TimeUnit, Scheduler)" -> "buffer(Duration, Duration, Scheduler)",
75+
"buffer(Func0[_ <: Observable[_ <: TClosing]])" -> "buffer(() => Observable[Any])",
76+
"buffer(Observable[B])" -> "buffer(Observable[Any])",
77+
"buffer(Observable[B], Int)" -> "buffer(Observable[Any], Int)",
78+
"buffer(Observable[_ <: TOpening], Func1[_ >: TOpening, _ <: Observable[_ <: TClosing]])" -> "buffer(Observable[Opening], Opening => Observable[Any])",
7479
"contains(T)" -> "contains(Any)",
7580
"count()" -> "length",
81+
"delay(Func0[_ <: Observable[U]], Func1[_ >: T, _ <: Observable[V]])" -> "delay(() => Observable[Any], T => Observable[Any])",
82+
"delay(Func1[_ >: T, _ <: Observable[U]])" -> "delay(T => Observable[Any])",
7683
"dematerialize()" -> "dematerialize(<:<[Observable[T], Observable[Notification[U]]])",
7784
"elementAt(Int)" -> "[use `.drop(index).first`]",
7885
"elementAtOrDefault(Int, T)" -> "[use `.drop(index).firstOrElse(default)`]",
@@ -116,6 +123,15 @@ class CompletenessTest extends JUnitSuite {
116123
"takeFirst()" -> "first",
117124
"takeFirst(Func1[_ >: T, Boolean])" -> commentForFirstWithPredicate,
118125
"takeLast(Int)" -> "takeRight(Int)",
126+
"takeLast(Long, TimeUnit)" -> "takeRight(Duration)",
127+
"takeLast(Long, TimeUnit, Scheduler)" -> "takeRight(Duration, Scheduler)",
128+
"takeLast(Int, Long, TimeUnit)" -> "takeRight(Int, Duration)",
129+
"takeLast(Int, Long, TimeUnit, Scheduler)" -> "takeRight(Int, Duration, Scheduler)",
130+
"takeLastBuffer(Int)" -> commentForTakeLastBuffer,
131+
"takeLastBuffer(Int, Long, TimeUnit)" -> commentForTakeLastBuffer,
132+
"takeLastBuffer(Int, Long, TimeUnit, Scheduler)" -> commentForTakeLastBuffer,
133+
"takeLastBuffer(Long, TimeUnit)" -> commentForTakeLastBuffer,
134+
"takeLastBuffer(Long, TimeUnit, Scheduler)" -> commentForTakeLastBuffer,
119135
"takeWhileWithIndex(Func2[_ >: T, _ >: Integer, Boolean])" -> "[use `.zipWithIndex.takeWhile{case (elem, index) => condition}.map(_._1)`]",
120136
"timeout(Func0[_ <: Observable[U]], Func1[_ >: T, _ <: Observable[V]], Observable[_ <: T])" -> "timeout(() => Observable[U], T => Observable[V], Observable[O])",
121137
"timeout(Func1[_ >: T, _ <: Observable[V]], Observable[_ <: T])" -> "timeout(() => Observable[U], T => Observable[V])",
@@ -154,8 +170,8 @@ class CompletenessTest extends JUnitSuite {
154170
"range(Int, Int)" -> "apply(Range)",
155171
"repeat()" -> "repeat()",
156172
"retry()" -> "retry()",
157-
"sequenceEqual(Observable[_ <: T], Observable[_ <: T])" -> "[use `(first zip second) map (p => p._1 == p._2)`]",
158-
"sequenceEqual(Observable[_ <: T], Observable[_ <: T], Func2[_ >: T, _ >: T, Boolean])" -> "[use `(first zip second) map (p => equality(p._1, p._2))`]",
173+
"sequenceEqual(Observable[_ <: T], Observable[_ <: T])" -> "sequenceEqual(Observable[U])",
174+
"sequenceEqual(Observable[_ <: T], Observable[_ <: T], Func2[_ >: T, _ >: T, Boolean])" -> "sequenceEqual(Observable[U], (U, U) => Boolean)",
159175
"sum(Observable[Integer])" -> "sum(Numeric[U])",
160176
"sumDoubles(Observable[Double])" -> "sum(Numeric[U])",
161177
"sumFloats(Observable[Float])" -> "sum(Numeric[U])",

0 commit comments

Comments
 (0)