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

Side by Side Diff: tests/lib/mirrors/library_uri_io_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 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 // Test library uri for a library read as a file.
6
7 library MirrorsTest;
ahe 2013/04/17 10:47:32 Add line between library declaration and imports.
Johnni Winther 2013/04/22 09:27:18 Done.
8 import "dart:mirrors";
9 import "../../../pkg/unittest/lib/unittest.dart";
10 import 'dart:io';
11 import 'dart:uri';
ahe 2013/04/17 10:47:32 Be consistent with quotes. Also, I prefer listing
Johnni Winther 2013/04/22 09:27:18 Done.
12
13 class Class {
14 }
15
16 testLibraryUri(var value, Uri expectedUri) {
17 var valueMirror = reflect(value);
18 ClassMirror valueClass = valueMirror.type;
19 LibraryMirror valueLibrary = valueClass.owner;
20 expect(valueLibrary.uri, equals(expectedUri));
21 }
22
23 main() {
24 var mirrors = currentMirrorSystem();
25 test("Test current library uri", () {
26 String appendSlash(String path) => path.endsWith('/') ? path : '$path/';
27 Uri cwd = new Uri.fromComponents(
28 scheme: 'file',
29 path: appendSlash(new Path(new File('.').fullPathSync()).toString()));
30 Uri uri = cwd.resolve(new Path(new Options().script).toString());
31 testLibraryUri(new Class(), uri);
32 });
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698