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

Side by Side Diff: tests/lib/mirrors/immutable_collections_test.dart

Issue 132133003: Extend the immutable collections test to the new API. Make *Members return immutable collections. A… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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/mirrors_impl.dart ('k') | no next file » | 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 test.immutable_collections; 5 library test.immutable_collections;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 someException(e) => e is Exception || e is Error; 10 someException(e) => e is Exception || e is Error;
(...skipping 24 matching lines...) Expand all
35 35
36 checkMethod(MethodMirror mm) { 36 checkMethod(MethodMirror mm) {
37 checkList(mm.parameters, 'MethodMirror.parameters'); 37 checkList(mm.parameters, 'MethodMirror.parameters');
38 checkList(mm.metadata, 'MethodMirror.metadata'); 38 checkList(mm.metadata, 'MethodMirror.metadata');
39 39
40 mm.parameters.forEach(checkParameter); 40 mm.parameters.forEach(checkParameter);
41 } 41 }
42 42
43 checkClass(ClassMirror cm) { 43 checkClass(ClassMirror cm) {
44 checkMap(cm.declarations, 'ClassMirror.declarations'); 44 checkMap(cm.declarations, 'ClassMirror.declarations');
45 checkMap(cm.instanceMembers, 'ClassMirror.instanceMembers');
46 checkMap(cm.staticMembers, 'ClassMirror.staticMembers');
45 checkList(cm.metadata, 'ClassMirror.metadata'); 47 checkList(cm.metadata, 'ClassMirror.metadata');
46 checkList(cm.superinterfaces, 'ClassMirror.superinterfaces'); 48 checkList(cm.superinterfaces, 'ClassMirror.superinterfaces');
47 checkList(cm.typeArguments, 'ClassMirror.typeArguments'); 49 checkList(cm.typeArguments, 'ClassMirror.typeArguments');
48 checkList(cm.typeVariables, 'ClassMirror.typeVariables'); 50 checkList(cm.typeVariables, 'ClassMirror.typeVariables');
49 51
50 cm.declarations.values.forEach(checkDeclaration); 52 cm.declarations.values.forEach(checkDeclaration);
53 cm.instanceMembers.values.forEach(checkDeclaration);
54 cm.staticMembers.values.forEach(checkDeclaration);
51 cm.typeVariables.forEach(checkTypeVariable); 55 cm.typeVariables.forEach(checkTypeVariable);
52 } 56 }
53 57
54 checkType(TypeMirror tm) { 58 checkType(TypeMirror tm) {
55 checkList(tm.metadata, 'TypeMirror.metadata'); 59 checkList(tm.metadata, 'TypeMirror.metadata');
56 } 60 }
57 61
58 checkDeclaration(DeclarationMirror dm) { 62 checkDeclaration(DeclarationMirror dm) {
59 if (dm is MethodMirror) checkMethod(dm); 63 if (dm is MethodMirror) checkMethod(dm);
60 if (dm is ClassMirror) checkClass(dm); 64 if (dm is ClassMirror) checkClass(dm);
61 if (dm is TypeMirror) checkType(dm); 65 if (dm is TypeMirror) checkType(dm);
62 if (dm is VariableMirror) checkVariable(dm); 66 if (dm is VariableMirror) checkVariable(dm);
63 if (dm is TypeVariableMirror) checkTypeVariable(dm); 67 if (dm is TypeVariableMirror) checkTypeVariable(dm);
64 } 68 }
65 69
66 checkLibrary(LibraryMirror lm) { 70 checkLibrary(LibraryMirror lm) {
67 checkMap(lm.declarations, 'LibraryMirror.declarations'); 71 checkMap(lm.declarations, 'LibraryMirror.declarations');
72 checkMap(lm.topLevelMembers, 'LibraryMirror.topLevelMembers');
68 checkList(lm.metadata, 'LibraryMirror.metadata'); 73 checkList(lm.metadata, 'LibraryMirror.metadata');
69 74
70 lm.declarations.values.forEach(checkDeclaration); 75 lm.declarations.values.forEach(checkDeclaration);
76 lm.topLevelMembers.values.forEach(checkDeclaration);
71 } 77 }
72 78
73 main() { 79 main() {
74 currentMirrorSystem().libraries.values.forEach(checkLibrary); 80 currentMirrorSystem().libraries.values.forEach(checkLibrary);
75 checkType(currentMirrorSystem().voidType); 81 checkType(currentMirrorSystem().voidType);
76 checkType(currentMirrorSystem().dynamicType); 82 checkType(currentMirrorSystem().dynamicType);
77 } 83 }
OLDNEW
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698