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

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

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 years, 9 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
7 main() { 5 main() {
8 test(expectation, iterable) { 6 test(expectation, iterable) {
9 Expect.listEquals(expectation, iterable.toList()); 7 Expect.listEquals(expectation, iterable.toList());
10 } 8 }
11 9
12 // Function not called on empty iterable. 10 // Function not called on empty iterable.
13 test([], [].expand((x) { throw "not called"; })); 11 test([], [].expand((x) { throw "not called"; }));
14 12
15 // Creating the iterable doesn't call the function. 13 // Creating the iterable doesn't call the function.
16 [1].expand((x) { throw "not called"; }); 14 [1].expand((x) { throw "not called"; });
(...skipping 16 matching lines...) Expand all
33 Iterator it = iterable.iterator; 31 Iterator it = iterable.iterator;
34 Expect.isTrue(it.moveNext()); 32 Expect.isTrue(it.moveNext());
35 Expect.equals(1, it.current); 33 Expect.equals(1, it.current);
36 Expect.isTrue(it.moveNext()); 34 Expect.isTrue(it.moveNext());
37 Expect.equals(1, it.current); 35 Expect.equals(1, it.current);
38 Expect.throws(it.moveNext, (e) => e == "FAIL"); 36 Expect.throws(it.moveNext, (e) => e == "FAIL");
39 // After throwing, iteration is ended. 37 // After throwing, iteration is ended.
40 Expect.equals(null, it.current); 38 Expect.equals(null, it.current);
41 Expect.isFalse(it.moveNext()); 39 Expect.isFalse(it.moveNext());
42 } 40 }
OLDNEW
« no previous file with comments | « tests/corelib/iterable_element_at_test.dart ('k') | tests/corelib/iterable_first_matching_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698