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

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

Issue 23429002: elementAt throws a RangeError not StateError. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 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 | « tests/co19/co19-co19.status ('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_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 "package:expect/expect.dart"; 10 import "package:expect/expect.dart";
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 test("elementAt", () { 239 test("elementAt", () {
240 StreamController c = new StreamController(); 240 StreamController c = new StreamController();
241 Future f = c.stream.elementAt(2); 241 Future f = c.stream.elementAt(2);
242 f.then(expectAsync1((v) { Expect.equals(13, v);})); 242 f.then(expectAsync1((v) { Expect.equals(13, v);}));
243 sentEvents.replay(c); 243 sentEvents.replay(c);
244 }); 244 });
245 245
246 test("elementAt 2", () { 246 test("elementAt 2", () {
247 StreamController c = new StreamController(); 247 StreamController c = new StreamController();
248 Future f = c.stream.elementAt(20); 248 Future f = c.stream.elementAt(20);
249 f.catchError(expectAsync1((error) { Expect.isTrue(error is StateError); })); 249 f.catchError(expectAsync1((error) { Expect.isTrue(error is RangeError); }));
250 sentEvents.replay(c); 250 sentEvents.replay(c);
251 }); 251 });
252 252
253 test("drain", () { 253 test("drain", () {
254 StreamController c = new StreamController(); 254 StreamController c = new StreamController();
255 Future f = c.stream.drain(); 255 Future f = c.stream.drain();
256 f.then(expectAsync1((v) { Expect.equals(null, v);})); 256 f.then(expectAsync1((v) { Expect.equals(null, v);}));
257 sentEvents.replay(c); 257 sentEvents.replay(c);
258 }); 258 });
259 259
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 testRethrow(); 683 testRethrow();
684 testBroadcastController(); 684 testBroadcastController();
685 testAsBroadcast(); 685 testAsBroadcast();
686 testSink(sync: true, broadcast: false, asBroadcast: false); 686 testSink(sync: true, broadcast: false, asBroadcast: false);
687 testSink(sync: true, broadcast: false, asBroadcast: true); 687 testSink(sync: true, broadcast: false, asBroadcast: true);
688 testSink(sync: true, broadcast: true, asBroadcast: false); 688 testSink(sync: true, broadcast: true, asBroadcast: false);
689 testSink(sync: false, broadcast: false, asBroadcast: false); 689 testSink(sync: false, broadcast: false, asBroadcast: false);
690 testSink(sync: false, broadcast: false, asBroadcast: true); 690 testSink(sync: false, broadcast: false, asBroadcast: true);
691 testSink(sync: false, broadcast: true, asBroadcast: false); 691 testSink(sync: false, broadcast: true, asBroadcast: false);
692 } 692 }
OLDNEW
« no previous file with comments | « tests/co19/co19-co19.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698