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

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

Issue 19267007: Fix test that fails in checked mode: a factory must return a subtype of its defining class. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/mirrors_test.dart
===================================================================
--- tests/lib/mirrors/mirrors_test.dart (revision 25024)
+++ tests/lib/mirrors/mirrors_test.dart (working copy)
@@ -17,7 +17,7 @@
Class.generative(this.field);
Class.redirecting(y) : this.generative(y*2);
- factory Class.faktory(y) => "FakeClass $y";
+ factory Class.faktory(y) => new Class.withInitialValue(y*3);
factory Class.redirectingFactory(y) = Class.faktory;
m(a, b, c) => {"a": a, "b": b, "c": c};
@@ -190,11 +190,14 @@
if (!isDart2js) {
instanceMirror = classMirror.newInstance(const Symbol('faktory'),
[9]);
- expect(instanceMirror.reflectee, equals('FakeClass 9'));
+ expect(instanceMirror.reflectee is Class, equals(true));
+ expect(instanceMirror.reflectee.field, equals(27));
+
instanceMirror = classMirror.newInstance(const Symbol('redirectingFactory'),
[10]);
- expect(instanceMirror.reflectee, equals('FakeClass 10'));
+ expect(instanceMirror.reflectee is Class, equals(true));
+ expect(instanceMirror.reflectee.field, equals(30));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698