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

Unified Diff: tests/corelib/src/ListTest.dart

Issue 9114021: Added method map to Collection interface and all its implementations (except classes generated fr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib/src/GrowableObjectArrayVMTest.dart ('k') | tests/corelib/src/QueueTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/src/ListTest.dart
===================================================================
--- tests/corelib/src/ListTest.dart (revision 3161)
+++ tests/corelib/src/ListTest.dart (working copy)
@@ -20,6 +20,13 @@
}
static void testClosures(List list) {
+ testMap(val) {return val * 2 + 10; }
+ Collection mapped = list.map(testMap);
+ Expect.equals(mapped.length, list.length);
+ for (var i = 0; i < list.length; i++) {
+ Expect.equals(mapped[i], list[i]*2 + 10);
+ }
+
testFilter(val) { return val == 3; }
Collection filtered = list.filter(testFilter);
Expect.equals(filtered.length, 1);
« no previous file with comments | « tests/corelib/src/GrowableObjectArrayVMTest.dart ('k') | tests/corelib/src/QueueTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698