Skip to content

Commit

Permalink
Merge pull request #361 from benjchristensen/issue-359-varargs
Browse files Browse the repository at this point in the history
Fix vararg issues reported in ReactiveX/RxJava#359
  • Loading branch information
benjchristensen committed Sep 10, 2013
2 parents 8ad0565 + b927038 commit febcc2a
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class UnitTestSuite extends JUnitSuite {
}

@Test def testSingleOrDefault {
assertEquals(0, Observable.from[Int]().toBlockingObservable.singleOrDefault(0))
assertEquals(0, Observable.empty[Int]().toBlockingObservable.singleOrDefault(0))
assertEquals(1, Observable.from(1).toBlockingObservable.singleOrDefault(0))
try {
Observable.from(1, 2, 3).toBlockingObservable.singleOrDefault(0)
Expand Down Expand Up @@ -135,8 +135,7 @@ class UnitTestSuite extends JUnitSuite {
@Test def testMerge {
val observable1 = Observable.from(1, 2, 3)
val observable2 = Observable.from(4, 5, 6)
val observableList = List(observable1, observable2).asJava
val merged = Observable.merge(observableList)
val merged = Observable.merge(observable1, observable2)
assertSubscribeReceives(merged)(1, 2, 3, 4, 5, 6)
}

Expand Down Expand Up @@ -232,13 +231,13 @@ class UnitTestSuite extends JUnitSuite {
@Test def testLastOrDefault {
val observable = Observable.from(1, 2, 3, 4)
assertEquals(4, observable.toBlockingObservable.lastOrDefault(5))
assertEquals(5, Observable.from[Int]().toBlockingObservable.lastOrDefault(5))
assertEquals(5, Observable.empty[Int]().toBlockingObservable.lastOrDefault(5))
}

@Test def testLastOrDefaultPredicate {
val observable = Observable.from(1, 2, 3, 4)
assertEquals(3, observable.toBlockingObservable.lastOrDefault(5, isOdd))
assertEquals(5, Observable.from[Int]().toBlockingObservable.lastOrDefault(5, isOdd))
assertEquals(5, Observable.empty[Int]().toBlockingObservable.lastOrDefault(5, isOdd))
}

@Test def testMap {
Expand Down

0 comments on commit febcc2a

Please sign in to comment.