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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import "package:expect/expect.dart";
6
5 main() { 7 main() {
6 test(expectation, iterable) { 8 test(expectation, iterable) {
7 Expect.listEquals(expectation, iterable.toList()); 9 Expect.listEquals(expectation, iterable.toList());
8 } 10 }
9 11
10 // Function not called on empty iterable. 12 // Function not called on empty iterable.
11 test([], [].expand((x) { throw "not called"; })); 13 test([], [].expand((x) { throw "not called"; }));
12 14
13 // Creating the iterable doesn't call the function. 15 // Creating the iterable doesn't call the function.
14 [1].expand((x) { throw "not called"; }); 16 [1].expand((x) { throw "not called"; });
(...skipping 16 matching lines...) Expand all
31 Iterator it = iterable.iterator; 33 Iterator it = iterable.iterator;
32 Expect.isTrue(it.moveNext()); 34 Expect.isTrue(it.moveNext());
33 Expect.equals(1, it.current); 35 Expect.equals(1, it.current);
34 Expect.isTrue(it.moveNext()); 36 Expect.isTrue(it.moveNext());
35 Expect.equals(1, it.current); 37 Expect.equals(1, it.current);
36 Expect.throws(it.moveNext, (e) => e == "FAIL"); 38 Expect.throws(it.moveNext, (e) => e == "FAIL");
37 // After throwing, iteration is ended. 39 // After throwing, iteration is ended.
38 Expect.equals(null, it.current); 40 Expect.equals(null, it.current);
39 Expect.isFalse(it.moveNext()); 41 Expect.isFalse(it.moveNext());
40 } 42 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698