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

Unified Diff: tests/lib/mirrors/constructor_kinds_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/basic_types_in_dart_core_test.dart ('k') | tests/lib/mirrors/constructors_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/constructor_kinds_test.dart
diff --git a/tests/lib/mirrors/constructor_kinds_test.dart b/tests/lib/mirrors/constructor_kinds_test.dart
index febac1f6f795e560fd98616e11795f49924be389..e083d0ecd4fac337deff5a07d1c60bdef1b50a93 100644
--- a/tests/lib/mirrors/constructor_kinds_test.dart
+++ b/tests/lib/mirrors/constructor_kinds_test.dart
@@ -42,7 +42,8 @@ main() {
const Class.constRedirectingFactoryConstructor(); /// 01: ok
cm = reflectClass(ClassWithDefaultConstructor);
- mm = cm.constructors.values.single;
+ mm = cm.declarations.values
+ .where((d) => d is MethodMirror && d.isConstructor).single;
Expect.isTrue(mm.isConstructor);
Expect.isTrue(mm.isGenerativeConstructor);
Expect.isFalse(mm.isFactoryConstructor);
@@ -51,42 +52,42 @@ main() {
cm = reflectClass(Class);
- mm = cm.constructors[#Class.generativeConstructor];
+ mm = cm.declarations[#Class.generativeConstructor];
Expect.isTrue(mm.isConstructor);
Expect.isTrue(mm.isGenerativeConstructor);
Expect.isFalse(mm.isFactoryConstructor);
Expect.isFalse(mm.isRedirectingConstructor);
Expect.isFalse(mm.isConstConstructor);
- mm = cm.constructors[#Class.redirectingGenerativeConstructor];
+ mm = cm.declarations[#Class.redirectingGenerativeConstructor];
Expect.isTrue(mm.isConstructor);
Expect.isTrue(mm.isGenerativeConstructor);
Expect.isFalse(mm.isFactoryConstructor);
Expect.isTrue(mm.isRedirectingConstructor);
Expect.isFalse(mm.isConstConstructor);
- mm = cm.constructors[#Class.factoryConstructor];
+ mm = cm.declarations[#Class.factoryConstructor];
Expect.isTrue(mm.isConstructor);
Expect.isFalse(mm.isGenerativeConstructor);
Expect.isTrue(mm.isFactoryConstructor);
Expect.isFalse(mm.isRedirectingConstructor);
Expect.isFalse(mm.isConstConstructor);
- mm = cm.constructors[#Class.redirectingFactoryConstructor];
+ mm = cm.declarations[#Class.redirectingFactoryConstructor];
Expect.isTrue(mm.isConstructor);
Expect.isFalse(mm.isGenerativeConstructor);
Expect.isTrue(mm.isFactoryConstructor);
Expect.isTrue(mm.isRedirectingConstructor);
Expect.isFalse(mm.isConstConstructor);
- mm = cm.constructors[#Class.constGenerativeConstructor];
+ mm = cm.declarations[#Class.constGenerativeConstructor];
Expect.isTrue(mm.isConstructor);
Expect.isTrue(mm.isGenerativeConstructor);
Expect.isFalse(mm.isFactoryConstructor);
Expect.isFalse(mm.isRedirectingConstructor);
Expect.isTrue(mm.isConstConstructor);
- mm = cm.constructors[#Class.constRedirectingGenerativeConstructor];
+ mm = cm.declarations[#Class.constRedirectingGenerativeConstructor];
Expect.isTrue(mm.isConstructor);
Expect.isTrue(mm.isGenerativeConstructor);
Expect.isFalse(mm.isFactoryConstructor);
@@ -94,14 +95,14 @@ main() {
Expect.isTrue(mm.isConstConstructor);
// Not legal.
- // mm = cm.constructors[#Class.constFactoryConstructor];
+ // mm = cm.declarations[#Class.constFactoryConstructor];
// Expect.isTrue(mm.isConstructor);
// Expect.isFalse(mm.isGenerativeConstructor);
// Expect.isTrue(mm.isFactoryConstructor);
// Expect.isFalse(mm.isRedirectingConstructor);
// Expect.isTrue(mm.isConstConstructor);
- mm = cm.constructors[#Class.constRedirectingFactoryConstructor];
+ mm = cm.declarations[#Class.constRedirectingFactoryConstructor];
Expect.isTrue(mm.isConstructor);
Expect.isFalse(mm.isGenerativeConstructor);
Expect.isTrue(mm.isFactoryConstructor);
« no previous file with comments | « tests/lib/mirrors/basic_types_in_dart_core_test.dart ('k') | tests/lib/mirrors/constructors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698