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

Unified Diff: tests/lib/mirrors/constructors_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/constructor_kinds_test.dart ('k') | tests/lib/mirrors/equality_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/constructors_test.dart
diff --git a/tests/lib/mirrors/constructors_test.dart b/tests/lib/mirrors/constructors_test.dart
index b55e440a7e6844dc0a76d66fba1808810c893ca7..ac13e3b218008b99d895a5500b2346b9d9a26640 100644
--- a/tests/lib/mirrors/constructors_test.dart
+++ b/tests/lib/mirrors/constructors_test.dart
@@ -10,6 +10,14 @@ import 'package:expect/expect.dart';
import 'stringify.dart';
+constructorsOf(ClassMirror cm) {
+ var result = new Map();
+ cm.declarations.forEach((k,v) {
+ if(v is MethodMirror && v.isConstructor) result[k] = v;
+ });
+ return result;
+}
+
class Foo {
}
@@ -28,13 +36,13 @@ class Biz {
main() {
ClassMirror fooMirror = reflectClass(Foo);
- Map<Symbol, MethodMirror> fooConstructors = fooMirror.constructors;
+ Map<Symbol, MethodMirror> fooConstructors = constructorsOf(fooMirror);
ClassMirror barMirror = reflectClass(Bar);
- Map<Symbol, MethodMirror> barConstructors = barMirror.constructors;
+ Map<Symbol, MethodMirror> barConstructors = constructorsOf(barMirror);
ClassMirror bazMirror = reflectClass(Baz);
- Map<Symbol, MethodMirror> bazConstructors = bazMirror.constructors;
+ Map<Symbol, MethodMirror> bazConstructors = constructorsOf(bazMirror);
ClassMirror bizMirror = reflectClass(Biz);
- Map<Symbol, MethodMirror> bizConstructors = bizMirror.constructors;
+ Map<Symbol, MethodMirror> bizConstructors = constructorsOf(bizMirror);
expect('{Foo: Method(s(Foo) in s(Foo), constructor)}', fooConstructors);
expect('{Bar: Method(s(Bar) in s(Bar), constructor)}', barConstructors);
« no previous file with comments | « tests/lib/mirrors/constructor_kinds_test.dart ('k') | tests/lib/mirrors/equality_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698