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

Unified Diff: tests/lib/mirrors/hierarchy_invariants_test.dart

Issue 68103016: When ClassMirrors are created by enumerating members of a LibraryMirror, have the ClassMirror use t… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 7 years, 1 month 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/lib/lib.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/hierarchy_invariants_test.dart
diff --git a/tests/lib/mirrors/hierarchy_invariants_test.dart b/tests/lib/mirrors/hierarchy_invariants_test.dart
index d636418fa49962c8738870534e67c25b525b6790..e35a076c0de5ada1fe38bc774c343dbe15f96fcd 100644
--- a/tests/lib/mirrors/hierarchy_invariants_test.dart
+++ b/tests/lib/mirrors/hierarchy_invariants_test.dart
@@ -12,9 +12,7 @@ isAnonymousMixinApplication(classMirror) {
return MirrorSystem.getName(classMirror.simpleName).contains(' with ');
}
-check(classMirror) {
- if (classMirror is TypedefMirror) return;
-
+checkClass(classMirror) {
Expect.isTrue(classMirror.simpleName is Symbol);
Expect.notEquals(null, classMirror.owner);
Expect.isTrue(classMirror.owner is LibraryMirror);
@@ -28,18 +26,16 @@ check(classMirror) {
if (classMirror.superclass == null) {
Expect.equals(reflectClass(Object), classMirror);
} else {
- check(classMirror.superclass);
+ checkClass(classMirror.superclass);
}
}
-main() {
- currentMirrorSystem().libraries.values.forEach((libraryMirror) {
- libraryMirror.declarations.values.forEach((declaration) {
- if (declaration is ClassMirror) check(declaration);
- });
- });
+checkLibrary(libraryMirror) {
+ libraryMirror.declarations.values
+ .where((d) => d is ClassMirror)
+ .forEach(checkClass);
+}
- Expect.throws(() => reflectClass(dynamic),
- (e) => e is ArgumentError,
- 'dynamic is not a class');
+main() {
+ currentMirrorSystem().libraries.values.forEach(checkLibrary);
}
« no previous file with comments | « tests/lib/lib.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698