OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library error_group_test; | 5 library error_group_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:unittest/unittest.dart'; | 9 import 'package:unittest/unittest.dart'; |
10 | 10 |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 expect(errorGroup.done, throwsFormatException); | 240 expect(errorGroup.done, throwsFormatException); |
241 controller.addError(new FormatException()); | 241 controller.addError(new FormatException()); |
242 }); | 242 }); |
243 | 243 |
244 test('should pass a signaled exception to the stream if it has a listener ' | 244 test('should pass a signaled exception to the stream if it has a listener ' |
245 'and should unsubscribe that stream', () { | 245 'and should unsubscribe that stream', () { |
246 // errorGroup shouldn't top-level the exception | 246 // errorGroup shouldn't top-level the exception |
247 expect(stream.first, throwsFormatException); | 247 expect(stream.first, throwsFormatException); |
248 errorGroup.signalError(new FormatException()); | 248 errorGroup.signalError(new FormatException()); |
249 | 249 |
250 expect(new Future(() { | 250 expect(newFuture(() { |
251 controller.add('value'); | 251 controller.add('value'); |
252 }), completes); | 252 }), completes); |
253 }); | 253 }); |
254 | 254 |
255 test('should notify the error group of a signaled exception even if the ' | 255 test('should notify the error group of a signaled exception even if the ' |
256 'stream has a listener', () { | 256 'stream has a listener', () { |
257 expect(stream.first, throwsFormatException); | 257 expect(stream.first, throwsFormatException); |
258 expect(errorGroup.done, throwsFormatException); | 258 expect(errorGroup.done, throwsFormatException); |
259 errorGroup.signalError(new FormatException()); | 259 errorGroup.signalError(new FormatException()); |
260 }); | 260 }); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 completion(equals(['value1', 'value2']))); | 437 completion(equals(['value1', 'value2']))); |
438 controller..add('value1')..add('value2')..close(); | 438 controller..add('value1')..add('value2')..close(); |
439 | 439 |
440 expect(signal.future.then((_) { | 440 expect(signal.future.then((_) { |
441 // shouldn't cause a top-level exception | 441 // shouldn't cause a top-level exception |
442 completer.completeError(new FormatException()); | 442 completer.completeError(new FormatException()); |
443 }), completes); | 443 }), completes); |
444 }); | 444 }); |
445 }); | 445 }); |
446 } | 446 } |
OLD | NEW |