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); |
} |