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

Side by Side Diff: tests/lib/mirrors/library_imports_metadata_test.dart

Issue 154733003: Access to imports in the VM's runtime mirrors. Extend test coverage of the source mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: sync Created 6 years, 9 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) 2014, 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 library test.library_imports;
6
7 import 'dart:mirrors';
8 import 'package:expect/expect.dart';
9 import 'stringify.dart';
10
11 import 'library_imports_metadata.dart';
12
13 main() {
14 LibraryMirror lib = currentMirrorSystem().findLibrary(#library_imports_metadat a);
15
16 LibraryMirror core = currentMirrorSystem().findLibrary(#dart.core);
17 LibraryMirror mirrors = currentMirrorSystem().findLibrary(#dart.mirrors);
18 LibraryMirror collection = currentMirrorSystem().findLibrary(#dart.collection) ;
19 LibraryMirror async = currentMirrorSystem().findLibrary(#dart.async);
20
21 Expect.setEquals([core, mirrors, collection, async],
22 lib.libraryDependencies.map((dep) => dep.targetLibrary));
23
24 Expect.stringEquals(
25 'import dart.async\n'
26 'import dart.collection\n'
27 'import dart.core\n'
28 'import dart.mirrors as mirrors\n',
29 stringifyDependencies(lib));
30
31 Expect.listEquals(
32 [].map(reflect).toList(),
33 lib.libraryDependencies
34 .singleWhere((dep) => dep.targetLibrary == core).metadata);
35
36 Expect.listEquals(
37 [m1].map(reflect).toList(),
38 lib.libraryDependencies
39 .singleWhere((dep) => dep.targetLibrary == mirrors).metadata);
40
41 Expect.listEquals(
42 [m2, m3].map(reflect).toList(),
43 lib.libraryDependencies
44 .singleWhere((dep) => dep.targetLibrary == collection).metadata);
45
46 Expect.listEquals(
47 [].map(reflect).toList(),
48 lib.libraryDependencies
49 .singleWhere((dep) => dep.targetLibrary == async).metadata);
50 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/library_imports_metadata.dart ('k') | tests/lib/mirrors/library_imports_prefixed.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698