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

Unified Diff: tests/lib/mirrors/fake_function_with_call_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/equality_test.dart ('k') | tests/lib/mirrors/field_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/fake_function_with_call_test.dart
diff --git a/tests/lib/mirrors/fake_function_with_call_test.dart b/tests/lib/mirrors/fake_function_with_call_test.dart
index 058a5675ffda20ee449e051a4440acdfa3763825..05523ef8be736a3222df2557f31b3509114fb6a4 100644
--- a/tests/lib/mirrors/fake_function_with_call_test.dart
+++ b/tests/lib/mirrors/fake_function_with_call_test.dart
@@ -6,6 +6,15 @@ import "dart:mirrors";
import "package:expect/expect.dart";
+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;
+}
+
class WannabeFunction {
int call(int a, int b) => a + b;
method(x) => x * x;
@@ -39,6 +48,6 @@ main() {
ClassMirror km = cm.type;
Expect.equals(reflectClass(WannabeFunction), km);
Expect.equals(#WannabeFunction, km.simpleName);
- Expect.equals(mm, km.members[#call]);
- Expect.setEquals([#call, #method], km.members.keys);
+ Expect.equals(mm, km.declarations[#call]);
+ Expect.setEquals([#call, #method], membersOf(km).keys);
}
« no previous file with comments | « tests/lib/mirrors/equality_test.dart ('k') | tests/lib/mirrors/field_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698