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

Side by Side Diff: runtime/tests/vm/dart/isolate_mirror_local_test.dart

Issue 11664006: Make Map.keys/values Iterables. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: Add TODO that map.keys should return a Set. Created 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/lib/immutable_map.dart ('k') | samples/swarm/Views.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) 2012, the Dart project authors. Please see the AUTHORS file 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 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 // Dart test program for checking implemention of MirrorSystem when 5 // Dart test program for checking implemention of MirrorSystem when
6 // inspecting the current isolate. 6 // inspecting the current isolate.
7 // 7 //
8 // VMOptions=--enable_type_checks 8 // VMOptions=--enable_type_checks
9 9
10 library isolate_mirror_local_test; 10 library isolate_mirror_local_test;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 lib_mirror.invoke('function', [ 123 ]).then( 119 lib_mirror.invoke('function', [ 123 ]).then(
120 (InstanceMirror retval) { 120 (InstanceMirror retval) {
121 Expect.equals(123, global_var); 121 Expect.equals(123, global_var);
122 Expect.equals('int', retval.type.simpleName); 122 Expect.equals('int', retval.type.simpleName);
123 Expect.isTrue(retval.hasReflectee); 123 Expect.isTrue(retval.hasReflectee);
124 Expect.equals(124, retval.reflectee); 124 Expect.equals(124, retval.reflectee);
125 testDone('testRootLibraryMirror'); 125 testDone('testRootLibraryMirror');
126 }); 126 });
127 127
128 // Check that the members map is complete. 128 // Check that the members map is complete.
129 List keys = lib_mirror.members.keys; 129 List keys = lib_mirror.members.keys.toList();
130 sort(keys); 130 sort(keys);
131 Expect.equals('[' 131 Expect.equals('['
132 'FuncType, ' 132 'FuncType, '
133 'GenericClass, ' 133 'GenericClass, '
134 'MyClass, ' 134 'MyClass, '
135 'MyException, ' 135 'MyException, '
136 'MyInterface, ' 136 'MyInterface, '
137 'MySuperClass, ' 137 'MySuperClass, '
138 '_stringCompare, ' 138 '_stringCompare, '
139 'buildMethodString, ' 139 'buildMethodString, '
(...skipping 16 matching lines...) Expand all
156 'testIntegerInstanceMirror, ' 156 'testIntegerInstanceMirror, '
157 'testLibrariesMap, ' 157 'testLibrariesMap, '
158 'testMirrorErrors, ' 158 'testMirrorErrors, '
159 'testMirrorSystem, ' 159 'testMirrorSystem, '
160 'testNullInstanceMirror, ' 160 'testNullInstanceMirror, '
161 'testRootLibraryMirror, ' 161 'testRootLibraryMirror, '
162 'testStringInstanceMirror]', 162 'testStringInstanceMirror]',
163 '$keys'); 163 '$keys');
164 164
165 // Check that the classes map is complete. 165 // Check that the classes map is complete.
166 keys = lib_mirror.classes.keys; 166 keys = lib_mirror.classes.keys.toList();
167 sort(keys); 167 sort(keys);
168 Expect.equals('[' 168 Expect.equals('['
169 'FuncType, ' 169 'FuncType, '
170 'GenericClass, ' 170 'GenericClass, '
171 'MyClass, ' 171 'MyClass, '
172 'MyException, ' 172 'MyException, '
173 'MyInterface, ' 173 'MyInterface, '
174 'MySuperClass]', 174 'MySuperClass]',
175 '$keys'); 175 '$keys');
176 176
177 // Check that the functions map is complete. 177 // Check that the functions map is complete.
178 keys = lib_mirror.functions.keys; 178 keys = lib_mirror.functions.keys.toList();
179 sort(keys); 179 sort(keys);
180 Expect.equals('[' 180 Expect.equals('['
181 '_stringCompare, ' 181 '_stringCompare, '
182 'buildMethodString, ' 182 'buildMethodString, '
183 'buildVariableString, ' 183 'buildVariableString, '
184 'function, ' 184 'function, '
185 'main, ' 185 'main, '
186 'methodWithError, ' 186 'methodWithError, '
187 'methodWithException, ' 187 'methodWithException, '
188 'myVar, ' 188 'myVar, '
189 'myVar=, ' 189 'myVar=, '
190 'sort, ' 190 'sort, '
191 'testBoolInstanceMirror, ' 191 'testBoolInstanceMirror, '
192 'testCustomInstanceMirror, ' 192 'testCustomInstanceMirror, '
193 'testDone, ' 193 'testDone, '
194 'testIntegerInstanceMirror, ' 194 'testIntegerInstanceMirror, '
195 'testLibrariesMap, ' 195 'testLibrariesMap, '
196 'testMirrorErrors, ' 196 'testMirrorErrors, '
197 'testMirrorSystem, ' 197 'testMirrorSystem, '
198 'testNullInstanceMirror, ' 198 'testNullInstanceMirror, '
199 'testRootLibraryMirror, ' 199 'testRootLibraryMirror, '
200 'testStringInstanceMirror]', 200 'testStringInstanceMirror]',
201 '$keys'); 201 '$keys');
202 202
203 // Check that the getters map is complete. 203 // Check that the getters map is complete.
204 keys = lib_mirror.getters.keys; 204 keys = lib_mirror.getters.keys.toList();
205 sort(keys); 205 sort(keys);
206 Expect.equals('[myVar]', '$keys'); 206 Expect.equals('[myVar]', '$keys');
207 207
208 // Check that the setters map is complete. 208 // Check that the setters map is complete.
209 keys = lib_mirror.setters.keys; 209 keys = lib_mirror.setters.keys.toList();
210 sort(keys); 210 sort(keys);
211 Expect.equals('[myVar=]', '$keys'); 211 Expect.equals('[myVar=]', '$keys');
212 212
213 // Check that the variables map is complete. 213 // Check that the variables map is complete.
214 keys = lib_mirror.variables.keys; 214 keys = lib_mirror.variables.keys.toList();
215 sort(keys); 215 sort(keys);
216 Expect.equals('[' 216 Expect.equals('['
217 'exit_port, ' 217 'exit_port, '
218 'expectedTests, ' 218 'expectedTests, '
219 'final_global_var, ' 219 'final_global_var, '
220 'global_var, ' 220 'global_var, '
221 'myFunc]', 221 'myFunc]',
222 '$keys'); 222 '$keys');
223 223
224 ClassMirror cls_mirror = lib_mirror.members['MyClass']; 224 ClassMirror cls_mirror = lib_mirror.members['MyClass'];
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 // Test that an isolate can reflect on itself. 521 // Test that an isolate can reflect on itself.
522 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem); 522 mirrorSystemOf(exit_port.toSendPort()).then(testMirrorSystem);
523 523
524 testIntegerInstanceMirror(reflect(1001)); 524 testIntegerInstanceMirror(reflect(1001));
525 testStringInstanceMirror(reflect('This\nis\na\nString')); 525 testStringInstanceMirror(reflect('This\nis\na\nString'));
526 testBoolInstanceMirror(reflect(true)); 526 testBoolInstanceMirror(reflect(true));
527 testNullInstanceMirror(reflect(null)); 527 testNullInstanceMirror(reflect(null));
528 testCustomInstanceMirror(reflect(new MyClass(17))); 528 testCustomInstanceMirror(reflect(new MyClass(17)));
529 testMirrorErrors(currentMirrorSystem()); 529 testMirrorErrors(currentMirrorSystem());
530 } 530 }
OLDNEW
« no previous file with comments | « runtime/lib/immutable_map.dart ('k') | samples/swarm/Views.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698