Skip to content

Commit f0ba525

Browse files
vanniktechakarnokd
authored andcommitted
2.x: Single.test dispose TestSubscriber when wanted (#4394)
1 parent 6a6a302 commit f0ba525

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/io/reactivex/Single.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2893,7 +2893,11 @@ public final TestSubscriber<T> test() {
28932893
*/
28942894
public final TestSubscriber<T> test(boolean cancelled) {
28952895
TestSubscriber<T> ts = new TestSubscriber<T>();
2896-
ts.dispose();
2896+
2897+
if (cancelled) {
2898+
ts.cancel();
2899+
}
2900+
28972901
toFlowable().subscribe(ts);
28982902
return ts;
28992903
}

0 commit comments

Comments
 (0)