Chromium Code Reviews| Index: tests/lib/mirrors/intercepted_class_test.dart |
| diff --git a/tests/lib/mirrors/intercepted_class_test.dart b/tests/lib/mirrors/intercepted_class_test.dart |
| index 2fde1b71b9e128307f516d205241fb51313cf697..0eb227d33a862fac8ed48060c097a1d563a88b03 100644 |
| --- a/tests/lib/mirrors/intercepted_class_test.dart |
| +++ b/tests/lib/mirrors/intercepted_class_test.dart |
| @@ -7,17 +7,28 @@ |
| library test.intercepted_class_test; |
| import 'dart:mirrors'; |
| +import 'package:expect/expect.dart'; |
| import 'stringify.dart' show stringify, expect; |
| checkClassMirror(ClassMirror cls, String name) { |
| - expect('s($name)', cls.simpleName); |
|
rmacnak
2013/09/27 01:38:27
Testing the class name is bogus because the implem
|
| + bool foundInterface = false; |
| + for(ClassMirror cm = cls; cm != null; cm = cm.superclass) { |
| + if (MirrorSystem.getName(cm.simpleName) == name) foundInterface = true; |
| + cm.superinterfaces.forEach((intf) { |
| + if (MirrorSystem.getName(intf.simpleName) == name) foundInterface = true; |
| + }); |
| + } |
| + Expect.isTrue(foundInterface, '$cls should implement $name'); |
| + |
| var variables = new Map(); |
| - cls.variables.forEach((Symbol key, VariableMirror value) { |
| - if (!value.isStatic && !value.isPrivate) { |
| - variables[key] = value; |
| - } |
| - }); |
| + for(ClassMirror cm = cls; cm != null; cm = cm.superclass) { |
| + cm.variables.forEach((Symbol key, VariableMirror value) { |
| + if (!value.isStatic && !value.isPrivate) { |
| + variables[key] = value; |
| + } |
| + }); |
| + } |
| expect('{}', variables); |
| } |