| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Test the basic StreamController and StreamController.singleSubscription. | 5 // Test the basic StreamController and StreamController.singleSubscription. |
| 6 library stream_controller_async_test; | 6 library stream_controller_async_test; |
| 7 | 7 |
| 8 import 'dart:async'; | 8 import 'dart:async'; |
| 9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 10 import '../../../pkg/unittest/lib/unittest.dart'; | 10 import '../../../pkg/unittest/lib/unittest.dart'; |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 f.then((v) { Expect.fail("unreachable"); }, | 432 f.then((v) { Expect.fail("unreachable"); }, |
| 433 onError: expectAsync1((e) { Expect.identical(error, e); })); | 433 onError: expectAsync1((e) { Expect.identical(error, e); })); |
| 434 // Need two values to trigger compare for min/max. | 434 // Need two values to trigger compare for min/max. |
| 435 c.add(0); | 435 c.add(0); |
| 436 c.add(1); | 436 c.add(1); |
| 437 c.close(); | 437 c.close(); |
| 438 }); | 438 }); |
| 439 } | 439 } |
| 440 | 440 |
| 441 testStream("where", (s, act) => s.where(act)); | 441 testStream("where", (s, act) => s.where(act)); |
| 442 testStream("mappedBy", (s, act) => s.map(act)); | 442 testStream("map", (s, act) => s.map(act)); |
| 443 testStream("expand", (s, act) => s.expand(act)); | 443 testStream("expand", (s, act) => s.expand(act)); |
| 444 testStream("where", (s, act) => s.where(act)); | 444 testStream("where", (s, act) => s.where(act)); |
| 445 testStreamError("handleError", (s, act) => s.handleError(act)); | 445 testStreamError("handleError", (s, act) => s.handleError(act)); |
| 446 testStreamError("handleTest", (s, act) => s.handleError((v) {}, test: act)); | 446 testStreamError("handleTest", (s, act) => s.handleError((v) {}, test: act)); |
| 447 testFuture("every", (s, act) => s.every(act)); | 447 testFuture("every", (s, act) => s.every(act)); |
| 448 testFuture("any", (s, act) => s.any(act)); | 448 testFuture("any", (s, act) => s.any(act)); |
| 449 testFuture("min", (s, act) => s.min((a, b) => act(b))); | 449 testFuture("min", (s, act) => s.min((a, b) => act(b))); |
| 450 testFuture("max", (s, act) => s.max((a, b) => act(b))); | 450 testFuture("max", (s, act) => s.max((a, b) => act(b))); |
| 451 testFuture("reduce", (s, act) => s.reduce(0, (a,b) => act(b))); | 451 testFuture("reduce", (s, act) => s.reduce(0, (a,b) => act(b))); |
| 452 } | 452 } |
| 453 | 453 |
| 454 main() { | 454 main() { |
| 455 testController(); | 455 testController(); |
| 456 testSingleController(); | 456 testSingleController(); |
| 457 testExtraMethods(); | 457 testExtraMethods(); |
| 458 testPause(); | 458 testPause(); |
| 459 testRethrow(); | 459 testRethrow(); |
| 460 } | 460 } |
| OLD | NEW |