Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(524)

Side by Side Diff: tests/lib/async/stream_controller_test.dart

Issue 19775015: Fixed bug in _ControllerStream.operator==. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/async/stream_controller.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_test; 6 library stream_controller_test;
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 import 'dart:async'; 9 import 'dart:async';
10 import 'event_helper.dart'; 10 import 'event_helper.dart';
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 StreamController c = new StreamController(sync: true); 409 StreamController c = new StreamController(sync: true);
410 Expect.isFalse(c.isClosed); 410 Expect.isFalse(c.isClosed);
411 c.add(42); 411 c.add(42);
412 Expect.isFalse(c.isClosed); 412 Expect.isFalse(c.isClosed);
413 c.addError("bad"); 413 c.addError("bad");
414 Expect.isFalse(c.isClosed); 414 Expect.isFalse(c.isClosed);
415 c.close(); 415 c.close();
416 Expect.isTrue(c.isClosed); 416 Expect.isTrue(c.isClosed);
417 } 417 }
418 418
419 void testStreamEquals() {
420 StreamController c;
421 c = new StreamController(sync: false);
422 Expect.equals(c.stream, c.stream);
423 c = new StreamController(sync: true);
424 Expect.equals(c.stream, c.stream);
425 c = new StreamController(sync: false, onListen:(){});
426 Expect.equals(c.stream, c.stream);
427 c = new StreamController(sync: true, onListen:(){});
428 Expect.equals(c.stream, c.stream);
429 c = new StreamController.broadcast(sync: false);
430 Expect.equals(c.stream, c.stream);
431 c = new StreamController.broadcast(sync: true);
432 Expect.equals(c.stream, c.stream);
433 c = new StreamController.broadcast(sync: false, onListen:(){});
434 Expect.equals(c.stream, c.stream);
435 c = new StreamController.broadcast(sync: true, onListen:(){});
floitsch 2013/07/19 11:47:40 maybe add test where it doesn't return true?
436 Expect.equals(c.stream, c.stream);
437 }
438
419 main() { 439 main() {
420 testMultiController(); 440 testMultiController();
421 testSingleController(); 441 testSingleController();
422 testExtraMethods(); 442 testExtraMethods();
423 testClosed(); 443 testClosed();
444 testStreamEquals();
424 } 445 }
OLDNEW
« no previous file with comments | « sdk/lib/async/stream_controller.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698