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

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

Issue 14135005: Fix 'collection' tests and co19 dartc/dart2js status files. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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/collection_from_test.dart ('k') | tests/corelib/collection_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
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 library map_test; 5 library map_test;
6 import 'dart:collection'; 6 import 'dart:collection';
7 7
8 // Test that length/isEmpty opertions are constant time on 8 // Test that length/isEmpty opertions are constant time on
9 // maps, strings and collections. 9 // maps, strings and collections.
10 10
(...skipping 15 matching lines...) Expand all
26 26
27 void testMap(Map map, int n) { 27 void testMap(Map map, int n) {
28 for (int i = 0; i < n; i++) { 28 for (int i = 0; i < n; i++) {
29 map[i] = i; 29 map[i] = i;
30 } 30 }
31 testLength(map, n); 31 testLength(map, n);
32 testLength(map.keys, n); 32 testLength(map.keys, n);
33 testLength(map.values, n); 33 testLength(map.values, n);
34 } 34 }
35 35
36 void testCollection(Collection collection, n) { 36 void testCollection(var collection, n) {
37 for (int i = 0; i < n; i++) { 37 for (int i = 0; i < n; i++) {
38 collection.add(i); 38 collection.add(i);
39 } 39 }
40 testLength(collection, n); 40 testLength(collection, n);
41 } 41 }
42 42
43 void testList(List list, n) { 43 void testList(List list, n) {
44 // Works even if list is fixed-length. 44 // Works even if list is fixed-length.
45 for (int i = 0; i < n; i++) { 45 for (int i = 0; i < n; i++) {
46 list[i] = i; 46 list[i] = i;
(...skipping 20 matching lines...) Expand all
67 testMap(new LinkedHashMap(), N); 67 testMap(new LinkedHashMap(), N);
68 testMap(new SplayTreeMap(), N); 68 testMap(new SplayTreeMap(), N);
69 testCollection(new HashSet(), N); 69 testCollection(new HashSet(), N);
70 testCollection(new LinkedHashSet(), N); 70 testCollection(new LinkedHashSet(), N);
71 testCollection(new ListQueue(), N); 71 testCollection(new ListQueue(), N);
72 testCollection(new DoubleLinkedQueue(), N); 72 testCollection(new DoubleLinkedQueue(), N);
73 testList(new List()..length = N, N); 73 testList(new List()..length = N, N);
74 testList(new List(N), N); 74 testList(new List(N), N);
75 testString(N); 75 testString(N);
76 } 76 }
OLDNEW
« no previous file with comments | « tests/corelib/collection_from_test.dart ('k') | tests/corelib/collection_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698