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

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

Issue 1066203004: Fix MethodMirror.source when the method is on the first line in a script. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | « tests/lib/mirrors/method_mirror_source_other.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/method_mirror_source_test.dart
diff --git a/tests/lib/mirrors/method_mirror_source_test.dart b/tests/lib/mirrors/method_mirror_source_test.dart
index d0aad92bdd1e22832e73edc3f93ef74c88ba5a20..78834a33601b68ae6c05f475730e84445ccf0ce0 100644
--- a/tests/lib/mirrors/method_mirror_source_test.dart
+++ b/tests/lib/mirrors/method_mirror_source_test.dart
@@ -3,8 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
import "dart:mirrors";
-
import "package:expect/expect.dart";
+import "method_mirror_source_other.dart";
expectSource(Mirror mirror, String source) {
MethodMirror methodMirror;
@@ -14,7 +14,7 @@ expectSource(Mirror mirror, String source) {
methodMirror = mirror as MethodMirror;
}
Expect.isTrue(methodMirror is MethodMirror);
- Expect.equals(methodMirror.source, source);
+ Expect.equals(source, methodMirror.source);
}
foo1() {}
@@ -98,4 +98,10 @@ main() {
var a = () {};
expectSource(reflect(namedClosure), "namedClosure(x,y,z) => 1;");
expectSource(reflect(a), "() {}");
+
+ // Function at first line.
+ expectSource(reflectClass(SomethingInOther).owner.declarations[#main],
+"""main() {
+ print("Blah");
+}""");
}
« no previous file with comments | « tests/lib/mirrors/method_mirror_source_other.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698