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

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

Issue 23226002: Implement ClassMirror.superinterfaces. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 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 | « dart/tests/lib/mirrors/mixin_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/lib/mirrors/stringify.dart
diff --git a/dart/tests/lib/mirrors/stringify.dart b/dart/tests/lib/mirrors/stringify.dart
index 731403bd2b4ea0105107463a50453463b8a717e8..977877238b7875e6206e434e048e45d35bbb5098 100644
--- a/dart/tests/lib/mirrors/stringify.dart
+++ b/dart/tests/lib/mirrors/stringify.dart
@@ -26,7 +26,7 @@ stringifyMap(Map map) {
return '{$buffer}';
}
-stringifyList(List list) {
+stringifyIterable(Iterable list) {
var buffer = new StringBuffer();
bool first = true;
for (String value in list.map(stringify)) {
@@ -100,7 +100,7 @@ stringifyMethod(MethodMirror method) {
stringify(value) {
if (value is Map) return stringifyMap(value);
- if (value is List) return stringifyList(value);
+ if (value is Iterable) return stringifyIterable(value);
if (value is ParameterMirror) return stringifyParameter(value);
if (value is VariableMirror) return stringifyVariable(value);
if (value is MethodMirror) return stringifyMethod(value);
@@ -111,8 +111,14 @@ stringify(value) {
throw 'Unexpected value: $value';
}
-expect(expected, actual) => Expect.stringEquals(expected, stringify(actual));
+expect(expected, actual, [String reason]) {
+ Expect.stringEquals(expected, stringify(actual), reason);
+}
compareSymbols(Symbol a, Symbol b) {
return MirrorSystem.getName(a).compareTo(MirrorSystem.getName(b));
}
+
+simpleNames(Iterable<Mirror> i) => i.map((e) => e.simpleName);
+
+sort(Iterable<Symbol> symbols) => symbols.toList()..sort(compareSymbols);
« no previous file with comments | « dart/tests/lib/mirrors/mixin_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698