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/corelib_strong/has_next_iterator_test.dart

Issue 2989643002: Migrate test block 8 to Dart 2.0. (Closed)
Patch Set: Merge Created 3 years, 4 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
« no previous file with comments | « tests/corelib_strong/growable_list_test.dart ('k') | tests/corelib_strong/hash_map2_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 library hasNextIterator.test;
6
7 import "package:expect/expect.dart";
8 import 'dart:collection';
9
10 main() {
11 var it = new HasNextIterator([].iterator);
12 Expect.isFalse(it.hasNext);
13 Expect.isFalse(it.hasNext);
14 Expect.throws(() => it.next(), (e) => e is StateError);
15 Expect.isFalse(it.hasNext);
16
17 it = new HasNextIterator([1].iterator);
18 Expect.isTrue(it.hasNext);
19 Expect.isTrue(it.hasNext);
20 Expect.equals(1, it.next());
21 Expect.isFalse(it.hasNext);
22 Expect.isFalse(it.hasNext);
23 Expect.throws(() => it.next(), (e) => e is StateError);
24 Expect.isFalse(it.hasNext);
25
26 it = new HasNextIterator([1, 2].iterator);
27 Expect.isTrue(it.hasNext);
28 Expect.isTrue(it.hasNext);
29 Expect.equals(1, it.next());
30 Expect.isTrue(it.hasNext);
31 Expect.isTrue(it.hasNext);
32 Expect.equals(2, it.next());
33 Expect.isFalse(it.hasNext);
34 Expect.isFalse(it.hasNext);
35 Expect.throws(() => it.next(), (e) => e is StateError);
36 Expect.isFalse(it.hasNext);
37 }
OLDNEW
« no previous file with comments | « tests/corelib_strong/growable_list_test.dart ('k') | tests/corelib_strong/hash_map2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698