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

Unified Diff: tests/compiler/dart2js/mirrors_test.dart

Issue 11729004: Refactor location computation in dart2js mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Location test added. Created 7 years, 12 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
Index: tests/compiler/dart2js/mirrors_test.dart
diff --git a/tests/compiler/dart2js/mirrors_test.dart b/tests/compiler/dart2js/mirrors_test.dart
index e0025b82086958c709ad478b39c56f536a132959..0930702aac0d1547d180455366b16aa0b2c73ed9 100644
--- a/tests/compiler/dart2js/mirrors_test.dart
+++ b/tests/compiler/dart2js/mirrors_test.dart
@@ -306,6 +306,20 @@ void testFoo(MirrorSystem system, LibraryMirror helperLibrary,
Expect.isTrue(data.hasReflectee);
Expect.isNull(data.reflectee);
});
+
+ //////////////////////////////////////////////////////////////////////////////
+ // Location test
+ //////////////////////////////////////////////////////////////////////////////
+
+ var fooClassLocation = fooClass.location;
+ Expect.isNotNull(fooClassLocation);
+ // Expect the location to start with the first metadata.
+ Expect.equals(348, fooClassLocation.offset, "Unexpected offset");
+ // Expect the location to end with the class body.
+ Expect.equals(227, fooClassLocation.length, "Unexpected length");
+ Expect.equals(17, fooClassLocation.line, "Unexpected line");
+ Expect.equals(1, fooClassLocation.column, "Unexpected column");
+
}
// Testing abstract class Bar:

Powered by Google App Engine
This is Rietveld 408576698