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

Side by Side Diff: test/codegen/lib/mirrors/library_exports_shown_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. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
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_exports_shown;
6
7 import 'dart:mirrors';
8 import 'package:expect/expect.dart';
9 import 'stringify.dart';
10
11 import 'library_exports_shown.dart';
12
13 test(MirrorSystem mirrors) {
14 LibraryMirror shown = mirrors.findLibrary(#library_exports_shown);
15 LibraryMirror a = mirrors.findLibrary(#library_imports_a);
16 LibraryMirror b = mirrors.findLibrary(#library_imports_b);
17
18 LibraryMirror core = mirrors.findLibrary(#dart.core);
19
20 Expect.setEquals([a, b, core],
21 shown.libraryDependencies.map((dep) => dep.targetLibrary));
22
23 Expect.stringEquals(
24 'import dart.core\n'
25 'export library_imports_a\n'
26 ' show somethingFromA\n'
27 ' show somethingFromBoth\n'
28 'export library_imports_b\n'
29 ' show somethingFromB\n',
30 stringifyDependencies(shown));
31 }
32
33 main() {
34 test(currentMirrorSystem());
35 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698