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

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

Issue 14251005: Change url to uri on LibraryMirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments + test status updated. Created 7 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/library_uri_package_test.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/mirrors_test.dart
diff --git a/tests/lib/mirrors/mirrors_test.dart b/tests/lib/mirrors/mirrors_test.dart
index a1bcf20be54ed972621da9e44c1f5ef67f57495e..3938fbb9360af546d26c170bab756fda03798785 100644
--- a/tests/lib/mirrors/mirrors_test.dart
+++ b/tests/lib/mirrors/mirrors_test.dart
@@ -8,6 +8,7 @@
library MirrorsTest;
import "dart:mirrors";
import "../../../pkg/unittest/lib/unittest.dart";
+import 'dart:uri';
var topLevelField;
@@ -151,6 +152,13 @@ testNames(mirrors) {
equals(const Symbol('MirrorsTest.Class.field')));
}
+testLibraryUri(var value, bool check(Uri)) {
+ var valueMirror = reflect(value);
+ ClassMirror valueClass = valueMirror.type;
+ LibraryMirror valueLibrary = valueClass.owner;
+ expect(check(valueLibrary.uri), isTrue);
+}
+
main() {
var mirrors = currentMirrorSystem();
test("Test reflective method invocation", () { testInvoke(mirrors); });
@@ -159,4 +167,11 @@ main() {
test("Test invoke constructor", () { testInvokeConstructor(mirrors); });
test("Test reflect type", () { testReflectClass(mirrors); });
test("Test simple and qualifiedName", () { testNames(mirrors); });
+ test("Test current library uri", () {
+ testLibraryUri(new Class(),
+ (Uri uri) => uri.path.endsWith('/mirrors_test.dart'));
+ });
+ test("Test dart library uri", () {
+ testLibraryUri("test", (Uri uri) => uri == Uri.parse('dart:core'));
+ });
}
« no previous file with comments | « tests/lib/mirrors/library_uri_package_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698