OLD | NEW |
---|---|
(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_deferred; | |
6 | |
7 import 'dart:mirrors'; | |
8 import 'package:expect/expect.dart'; | |
9 import 'stringify.dart'; | |
10 | |
11 import 'dart:collection' deferred as lazycollection; | |
siva
2015/02/14 00:25:22
Need to add a test which imports the same library
rmacnak
2015/02/14 00:37:54
Done.
| |
12 | |
13 test(MirrorSystem mirrors) { | |
14 LibraryMirror thisLibrary = | |
15 mirrors.findLibrary(#test.library_imports_deferred); | |
16 LibraryMirror collection = | |
17 mirrors.findLibrary(#dart.collection); | |
18 | |
19 LibraryDependencyMirror dep = | |
20 thisLibrary.libraryDependencies.singleWhere((dep) => dep.isDeferred); | |
21 Expect.equals(collection, dep.targetLibrary); | |
22 | |
23 Expect.stringEquals( | |
24 'import dart.collection deferred as lazycollection\n' | |
25 ' hide loadLibrary\n' | |
26 'import dart.core\n' | |
27 'import dart.mirrors\n' | |
28 'import expect\n' | |
29 'import test.stringify\n', | |
30 stringifyDependencies(thisLibrary)); | |
31 } | |
32 | |
33 main() { | |
34 test(currentMirrorSystem()); | |
35 } | |
OLD | NEW |