OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #import("../../../pkg/dartdoc/lib/mirrors.dart"); | 5 import '../../../sdk/lib/_internal/dartdoc/lib/mirrors.dart'; |
6 #import("../../../pkg/dartdoc/lib/mirrors_util.dart"); | 6 import '../../../sdk/lib/_internal/dartdoc/lib/mirrors_util.dart'; |
7 | 7 |
8 #import('dart:io'); | 8 import 'dart:io'; |
9 | 9 |
10 int count(Iterable iterable) { | 10 int count(Iterable iterable) { |
11 var count = 0; | 11 var count = 0; |
12 for (var element in iterable) { | 12 for (var element in iterable) { |
13 count++; | 13 count++; |
14 } | 14 } |
15 return count; | 15 return count; |
16 } | 16 } |
17 | 17 |
18 bool containsType(TypeMirror expected, Iterable<TypeMirror> iterable) { | 18 bool containsType(TypeMirror expected, Iterable<TypeMirror> iterable) { |
(...skipping 10 matching lines...) Expand all Loading... |
29 if (mirror.simpleName == name) { | 29 if (mirror.simpleName == name) { |
30 return mirror; | 30 return mirror; |
31 } | 31 } |
32 } | 32 } |
33 return null; | 33 return null; |
34 } | 34 } |
35 | 35 |
36 main() { | 36 main() { |
37 var scriptPath = new Path.fromNative(new Options().script); | 37 var scriptPath = new Path.fromNative(new Options().script); |
38 var dirPath = scriptPath.directoryPath; | 38 var dirPath = scriptPath.directoryPath; |
39 var libPath = dirPath.join(new Path.fromNative('../../../')); | 39 var libPath = dirPath.join(new Path.fromNative('../../../sdk/lib')); |
40 var inputPath = dirPath.join(new Path.fromNative('mirrors_helper.dart')); | 40 var inputPath = dirPath.join(new Path.fromNative('mirrors_helper.dart')); |
41 var compilation = new Compilation.library([inputPath], libPath); | 41 var compilation = new Compilation.library([inputPath], libPath); |
42 Expect.isNotNull(compilation, "No compilation created"); | 42 Expect.isNotNull(compilation, "No compilation created"); |
43 | 43 |
44 var mirrors = compilation.mirrors; | 44 var mirrors = compilation.mirrors; |
45 Expect.isNotNull(mirrors, "No mirror system returned from compilation"); | 45 Expect.isNotNull(mirrors, "No mirror system returned from compilation"); |
46 | 46 |
47 var libraries = mirrors.libraries; | 47 var libraries = mirrors.libraries; |
48 Expect.isNotNull(libraries, "No libraries map returned"); | 48 Expect.isNotNull(libraries, "No libraries map returned"); |
49 Expect.isFalse(libraries.isEmpty, "Empty libraries map returned"); | 49 Expect.isFalse(libraries.isEmpty, "Empty libraries map returned"); |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 privateClass.members['_PrivateClass._privateFactoryConstructor']; | 771 privateClass.members['_PrivateClass._privateFactoryConstructor']; |
772 Expect.isNotNull(privateFactoryConstructor); | 772 Expect.isNotNull(privateFactoryConstructor); |
773 Expect.isTrue(privateFactoryConstructor is MethodMirror); | 773 Expect.isTrue(privateFactoryConstructor is MethodMirror); |
774 Expect.isTrue(privateFactoryConstructor.isConstructor); | 774 Expect.isTrue(privateFactoryConstructor.isConstructor); |
775 Expect.isTrue(privateFactoryConstructor.isPrivate); | 775 Expect.isTrue(privateFactoryConstructor.isPrivate); |
776 Expect.isFalse(privateFactoryConstructor.isConstConstructor); | 776 Expect.isFalse(privateFactoryConstructor.isConstConstructor); |
777 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); | 777 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); |
778 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); | 778 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); |
779 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); | 779 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); |
780 } | 780 } |
OLD | NEW |