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

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

Issue 921163004: Add LibraryDependencyMirror.isDeferred. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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_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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698