Chromium Code Reviews

Side by Side Diff: test/codegen/lib/mirrors/library_uri_io_test.dart

Issue 2265533002: Add mirrors tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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;
8
9 import 'dart:mirrors';
10 import 'dart:io';
11 import 'package:unittest/unittest.dart';
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 Uri uri = Uri.base.resolveUri(Platform.script);
27 testLibraryUri(new Class(), uri);
28 });
29 }
OLDNEW
« no previous file with comments | « test/codegen/lib/mirrors/library_metatarget_test_lib.dart ('k') | test/codegen/lib/mirrors/library_uri_package_test.dart » ('j') | no next file with comments »

Powered by Google App Engine