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

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

Issue 14118011: - Implement reflectClass. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 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
« runtime/lib/mirrors_patch.dart ('K') | « sdk/lib/mirrors/mirrors.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/mirrors_test.dart
===================================================================
--- tests/lib/mirrors/mirrors_test.dart (revision 21604)
+++ tests/lib/mirrors/mirrors_test.dart (working copy)
@@ -109,6 +109,17 @@
}));
}
+testReflectClass(mirrors) {
+ var classMirror = reflectClass(Class);
+ expect(classMirror is ClassMirror, equals(true));
+ var symbolClassMirror = reflectClass(Symbol);
+ var symbolMirror = symbolClassMirror.newInstance(const Symbol(''),
+ ['withInitialValue']);
+ var objectMirror = classMirror.newInstance(symbolMirror.reflectee,[1234]);
ahe 2013/04/17 10:40:17 I'm not sure why you created a symbol mirror here,
ahe 2013/04/17 10:40:17 Missing space after ,
+ expect(objectMirror.reflectee is Class, equals(true));
+ expect(objectMirror.reflectee.field, equals(1234));
+}
+
testNames(mirrors) {
var libMirror = mirrors.libraries[const Symbol('MirrorsTest')];
var classMirror = libMirror.classes[const Symbol('Class')];
@@ -146,5 +157,6 @@
test("Test field access", () { testFieldAccess(mirrors); });
test("Test closure mirrors", () { testClosureMirrors(mirrors); });
test("Test invoke constructor", () { testInvokeConstructor(mirrors); });
+ test("Test reflect type", () { testReflectClass(mirrors); });
test("Test simple and qualifiedName", () { testNames(mirrors); });
}
« runtime/lib/mirrors_patch.dart ('K') | « sdk/lib/mirrors/mirrors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698