Skip to content

Commit

Permalink
Merge pull request #1453 from spodila/takeWhileFailure
Browse files Browse the repository at this point in the history
New test case for takeWhile that currently fails
  • Loading branch information
benjchristensen committed Jul 17, 2014
2 parents 877ee89 + ce6a6fb commit cb20468
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions rxjava-core/src/test/java/rx/ObservableTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -1027,4 +1027,29 @@ public Observable<String> call(String s) {
});
o.subscribe();
}

@Test
public void testTakeWhileToList() {
int[] nums = {1, 2, 3};
final AtomicInteger count = new AtomicInteger();
for(final int n: nums) {
Observable
.from(Boolean.TRUE, Boolean.FALSE)
.takeWhile(new Func1<Boolean, Boolean>() {
@Override
public Boolean call(Boolean value) {
return value;
}
})
.toList()
.doOnNext(new Action1<List<Boolean>>() {
@Override
public void call(List<Boolean> booleans) {
count.incrementAndGet();
}
})
.subscribe();
}
assertEquals(nums.length, count.get());
}
}

0 comments on commit cb20468

Please sign in to comment.