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

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

Issue 64793003: Update mirror tests for removed API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: . 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/mirrors/mixin_application_test.dart ('k') | tests/lib/mirrors/operator_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/mixin_members_test.dart
diff --git a/tests/lib/mirrors/mixin_members_test.dart b/tests/lib/mirrors/mixin_members_test.dart
index 12c4192c089ced729f1da5aff9baf49eb47bfb15..2655892b74ae72ef8b143450ab5c63fe0da77f14 100644
--- a/tests/lib/mirrors/mixin_members_test.dart
+++ b/tests/lib/mirrors/mixin_members_test.dart
@@ -31,26 +31,35 @@ class M2 {
class C extends S with M1, M2 {}
+membersOf(ClassMirror cm) {
+ var result = new Map();
+ cm.declarations.forEach((k,v) {
+ if(v is MethodMirror && !v.isConstructor) result[k] = v;
+ if(v is VariableMirror) result[k] = v;
+ });
+ return result;
+}
+
main() {
ClassMirror cm = reflectClass(C);
ClassMirror sM1M2 = cm.superclass;
ClassMirror sM1 = sM1M2.superclass;
ClassMirror s = sM1.superclass;
- expect('{}', cm.members);
+ expect('{}', membersOf(cm));
expect('[s(baz1), s(baz2)]',
// TODO(ahe): Shouldn't have to sort.
- sort(sM1M2.members.keys),
+ sort(membersOf(sM1M2).keys),
'(S with M1, M2).members');
expect('[s(M2)]', simpleNames(sM1M2.superinterfaces),
'(S with M1, M2).superinterfaces');
expect('[s(bar1), s(bar2)]',
// TODO(ahe): Shouldn't have to sort.
- sort(sM1.members.keys), '(S with M1).members');
+ sort(membersOf(sM1).keys), '(S with M1).members');
expect('[s(M1)]', simpleNames(sM1.superinterfaces),
'(S with M1).superinterfaces');
expect('[s(foo1), s(foo2)]',
// TODO(ahe): Shouldn't have to sort.
- sort(s.members.keys), 's.members');
+ sort(membersOf(s).keys), 's.members');
expect('[s(Fooer)]', simpleNames(s.superinterfaces), 's.superinterfaces');
Expect.equals(s, reflectClass(S));
}
« no previous file with comments | « tests/lib/mirrors/mixin_application_test.dart ('k') | tests/lib/mirrors/operator_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698