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

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

Issue 34133002: Cover an example of equality and hashCode for each type of mirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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 | « runtime/lib/mirrors_impl.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/equality_test.dart
diff --git a/tests/lib/mirrors/equality_test.dart b/tests/lib/mirrors/equality_test.dart
index 77e724f08adf6fa3277e7ed04cf6963bea8c5de4..94c98561c342d7a69265028402d5e3fb61601fdd 100644
--- a/tests/lib/mirrors/equality_test.dart
+++ b/tests/lib/mirrors/equality_test.dart
@@ -24,6 +24,9 @@ class BadEqualityHash {
int get hashCode => count++;
}
+typedef bool Predicate(Object o);
+Predicate somePredicate;
+
checkEquality(List<Map> equivalenceClasses) {
for (var equivalenceClass in equivalenceClasses) {
equivalenceClass.forEach((name, member) {
@@ -117,6 +120,38 @@ main() {
'thisLibrary.classes[#B]' : thisLibrary.classes[#B],
'reflect(new B()).type' : reflect(new B()).type},
+ {'reflectClass(BadEqualityHash).methods[#==]' /// 02: ok
+ : reflectClass(BadEqualityHash).methods[#==], /// 02: ok
+ 'reflect(new BadEqualityHash()).type.methods[#==]' /// 02: ok
+ : reflect(new BadEqualityHash()).type.methods[#==]}, /// 02: ok
+
+ {'reflectClass(BadEqualityHash).methods[#==].parameters[0]' /// 02: ok
+ : reflectClass(BadEqualityHash).methods[#==].parameters[0], /// 02: ok
+ 'reflect(new BadEqualityHash()).type.methods[#==].parameters[0]' /// 02: ok
+ : reflect(new BadEqualityHash()).type.methods[#==].parameters[0]}, /// 02: ok
+
+ {'reflectClass(BadEqualityHash).variables[#count]' /// 02: ok
+ : reflectClass(BadEqualityHash).variables[#count], /// 02: ok
+ 'reflect(new BadEqualityHash()).type.variables[#count]' /// 02: ok
+ : reflect(new BadEqualityHash()).type.variables[#count]}, /// 02: ok
+
+ {'reflectType(Predicate)' : reflectType(Predicate), /// 02: ok
+ 'thisLibrary.variables[#somePredicate].type' /// 02: ok
+ : thisLibrary.variables[#somePredicate].type}, /// 02: ok
+
+ {'reflectType(Predicate).referent' : reflectType(Predicate).referent, /// 02: ok
+ 'thisLibrary.variables[#somePredicate].type.referent' /// 02: ok
+ : thisLibrary.variables[#somePredicate].type.referent}, /// 02: ok
+
+ {'reflectClass(A).typeVariables.single' /// 02: ok
+ : reflectClass(A).typeVariables.single, /// 02: ok
+ 'reflect(new A<int>()).type.originalDeclaration.typeVariables.single' /// 02: ok
+ : reflect(new A<int>()).type.originalDeclaration.typeVariables.single}, /// 02: ok
+
+ {'currentMirrorSystem()' : currentMirrorSystem()},
+
+ {'currentMirrorSystem().isolate' : currentMirrorSystem().isolate},
+
{'thisLibrary' : thisLibrary,
'reflectClass(A).owner' : reflectClass(A).owner,
'reflectClass(B).owner' : reflectClass(B).owner,
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698