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: test_reflectable/test/basic_test.dart

Issue 1289933004: Implements support for reflection on parameters. (Closed) Base URL: https://github.com/dart-lang/reflectable.git@master
Patch Set: Merging with code from Sigurd, caused several adjustments Created 5 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 | « test_reflectable/pubspec.yaml ('k') | test_reflectable/test/capabilities_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test_reflectable/test/basic_test.dart
diff --git a/test_reflectable/test/basic_test.dart b/test_reflectable/test/basic_test.dart
index b59586b2a96a409412ba99dde7428fc04ae216c5..712496891a9a754c804bb89c0c4d67acf7d75dcd 100644
--- a/test_reflectable/test/basic_test.dart
+++ b/test_reflectable/test/basic_test.dart
@@ -12,7 +12,8 @@ import 'package:reflectable/capability.dart';
class MyReflectable extends r.Reflectable {
const MyReflectable()
- : super(instanceInvokeCapability, newInstanceCapability);
+ : super(instanceInvokeCapability, newInstanceCapability,
+ declarationsCapability);
}
@MyReflectable()
@@ -23,6 +24,7 @@ class A {
set accessor(x) {
accessorBackingStorageA = x;
}
+
aMethod() => 'aMethod';
}
@@ -34,6 +36,7 @@ class B extends A {
set accessor(x) {
accessorBackingStorageB = x;
}
+
bMethod() => 'bMethod';
}
@@ -42,11 +45,13 @@ class C extends B {
set foo(x) {
fooBackingStorageC = x;
}
+
instanceMethod(x) => 'C:instanceMethod($x)';
get accessor => 'C:get accessor';
set accessor(x) {
accessorBackingStorageC = x;
}
+
cMethod() => 'cMethod';
}
@@ -81,8 +86,8 @@ List<r.MethodMirror> settersOf(r.ClassMirror cm) {
}
List<r.MethodMirror> methodsOf(r.ClassMirror cm) {
- return filteredDeclarationsOf(cm,
- (v) => v is r.MethodMirror && v.isRegularMethod);
+ return filteredDeclarationsOf(
+ cm, (v) => v is r.MethodMirror && v.isRegularMethod);
}
Matcher throwsNoSuchCapabilityError = throwsA(isNoSuchCapabilityError);
@@ -178,10 +183,8 @@ main() {
expect(gettersOf(bClass).map((x) => x.simpleName),
["accessor", "foo"].toSet());
expect(gettersOf(cClass).map((x) => x.simpleName), ["accessor"]);
- expect(settersOf(aClass).map((x) => x.simpleName),
- ["accessor="]);
- expect(settersOf(bClass).map((x) => x.simpleName),
- ["accessor="].toSet());
+ expect(settersOf(aClass).map((x) => x.simpleName), ["accessor="]);
+ expect(settersOf(bClass).map((x) => x.simpleName), ["accessor="].toSet());
expect(settersOf(cClass).map((x) => x.simpleName),
["accessor=", "foo="].toSet());
expect(methodsOf(aClass).map((x) => x.simpleName),
« no previous file with comments | « test_reflectable/pubspec.yaml ('k') | test_reflectable/test/capabilities_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698