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

Side by Side Diff: tests/corelib/has_next_iterator_test.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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/corelib/futures_test.dart ('k') | tests/corelib/indexed_list_access_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 main() {
6 var it = new HasNextIterator([].iterator);
7 Expect.isFalse(it.hasNext);
8 Expect.isFalse(it.hasNext);
9 Expect.throws(() => it.next(), (e) => e is StateError);
10 Expect.isFalse(it.hasNext);
11
12 it = new HasNextIterator([1].iterator);
13 Expect.isTrue(it.hasNext);
14 Expect.isTrue(it.hasNext);
15 Expect.equals(1, it.next());
16 Expect.isFalse(it.hasNext);
17 Expect.isFalse(it.hasNext);
18 Expect.throws(() => it.next(), (e) => e is StateError);
19 Expect.isFalse(it.hasNext);
20
21 it = new HasNextIterator([1, 2].iterator);
22 Expect.isTrue(it.hasNext);
23 Expect.isTrue(it.hasNext);
24 Expect.equals(1, it.next());
25 Expect.isTrue(it.hasNext);
26 Expect.isTrue(it.hasNext);
27 Expect.equals(2, it.next());
28 Expect.isFalse(it.hasNext);
29 Expect.isFalse(it.hasNext);
30 Expect.throws(() => it.next(), (e) => e is StateError);
31 Expect.isFalse(it.hasNext);
32 }
OLDNEW
« no previous file with comments | « tests/corelib/futures_test.dart ('k') | tests/corelib/indexed_list_access_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698