File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ void main() {
89
89
90
90
changeNotifier.notifyListeners ();
91
91
});
92
+
93
+ test ('Emits done when Listenable.addListener throws' , () {
94
+ final changeNotifier = ChangeNotifier ()..dispose ();
95
+ expect (
96
+ changeNotifier.toStream (),
97
+ emitsDone,
98
+ );
99
+ });
92
100
});
93
101
94
102
group ('ValueListenableToStream' , () {
@@ -269,5 +277,25 @@ void main() {
269
277
valueNotifier.value = 5 ;
270
278
});
271
279
});
280
+
281
+ test (
282
+ 'Emits done when ValueNotifier.addListener throws and not replay value' ,
283
+ () {
284
+ final valueNotifier = ValueNotifier (0 )..dispose ();
285
+ expect (
286
+ valueNotifier.toValueStream (),
287
+ emitsDone,
288
+ );
289
+ });
290
+
291
+ test (
292
+ 'Emits value and done when ValueNotifier.addListener throws and replay value' ,
293
+ () {
294
+ final valueNotifier = ValueNotifier (0 )..dispose ();
295
+ expect (
296
+ valueNotifier.toValueStream (replayValue: true ),
297
+ emitsInOrder ([0 , emitsDone]),
298
+ );
299
+ });
272
300
});
273
301
}
You can’t perform that action at this time.
0 commit comments