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

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

Issue 23226002: Implement ClassMirror.superinterfaces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/tests/lib/mirrors/hierarchy_test.dart ('k') | dart/tests/lib/mirrors/mixin_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/lib/mirrors/mixin_members_test.dart
diff --git a/dart/tests/lib/mirrors/mixin_members_test.dart b/dart/tests/lib/mirrors/mixin_members_test.dart
index 4b82534d48cc02baf697b4559c769885bcccdc34..eca7166c040fb6f52e202541beb5f2d918d8a1d1 100644
--- a/dart/tests/lib/mirrors/mixin_members_test.dart
+++ b/dart/tests/lib/mirrors/mixin_members_test.dart
@@ -2,10 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+library mixin_members_test;
+
+// TODO(ahe): Don't add mirrors used, the test doesn't work without it.
+@MirrorsUsed(targets: 'mixin_members_test', override: '*')
import "dart:mirrors";
import "package:expect/expect.dart";
+import 'stringify.dart';
+
class Fooer {
foo1();
}
@@ -29,21 +35,24 @@ class C extends S with M1, M2 {}
main() {
ClassMirror cm = reflectClass(C);
- Classmirror sM1M2 = cm.superclass;
- Classmirror sM1 = sM1M2.superclass;
+ ClassMirror sM1M2 = cm.superclass;
+ ClassMirror sM1 = sM1M2.superclass;
ClassMirror s = sM1.superclass;
- Expect.equals(0, cm.members.length);
- Expect.setEquals(sM1M2.members.keys,
- [const Symbol("baz1"), const Symbol("baz2")]);
- Expect.setEquals(sM1M2.superinterfaces.map((e) => e.simpleName),
- [const Symbol("M2")]);
- Expect.setEquals(sM1.members.keys,
- [const Symbol("bar1"), const Symbol("bar2")]);
- Expect.setEquals(sM1.superinterfaces.map((e) => e.simpleName),
- [const Symbol("M1")]);
- Expect.setEquals(s.members.keys.toSet(),
- [const Symbol("foo1"), const Symbol("foo2")]);
- Expect.setEquals(s.superinterfaces.map((e) => e.simpleName),
- [const Symbol("Fooer")]);
- Expect.equals(true, reflectClass(S) == s);
+ expect('{}', cm.members);
+ expect('[s(baz1), s(baz2)]',
+ // TODO(ahe): Shouldn't have to sort.
+ sort(sM1M2.members.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');
+ 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');
+ expect('[s(Fooer)]', simpleNames(s.superinterfaces), 's.superinterfaces');
+ Expect.equals(s, reflectClass(S));
}
« no previous file with comments | « dart/tests/lib/mirrors/hierarchy_test.dart ('k') | dart/tests/lib/mirrors/mixin_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698