File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
rxjava-core/src/main/java/rx/operators Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,18 @@ public void testTake2() {
260
260
verify (aObserver , times (1 )).onCompleted ();
261
261
}
262
262
263
+ @ Test
264
+ public void testTakeDoesntLeakErrors () {
265
+ Observable <String > source = Observable .concat (Observable .from ("one" ), Observable .<String >error (new Exception ("test failed" )));
266
+ Observable .create (take (source , 1 )).last ();
267
+ }
268
+
269
+ @ Test
270
+ public void testTakeZeroDoesntLeakError () {
271
+ Observable <String > source = Observable .<String >error (new Exception ("test failed" ));
272
+ Observable .create (take (source , 0 )).lastOrDefault ("ok" );
273
+ }
274
+
263
275
@ Test
264
276
public void testUnsubscribeAfterTake () {
265
277
Subscription s = mock (Subscription .class );
You can’t perform that action at this time.
0 commit comments