| 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("../../../pkg/dartdoc/lib/mirrors.dart"); |
| 6 #import("../../../pkg/dartdoc/lib/mirrors_util.dart"); | 6 #import("../../../pkg/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) { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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"); |
| 50 | 50 |
| 51 var helperLibrary = libraries["mirrors_helper"]; | 51 var helperLibrary = libraries["mirrors_helper"]; |
| 52 Expect.isNotNull(helperLibrary, "Library 'mirrors_helper' not found"); | 52 Expect.isNotNull(helperLibrary, "Library 'mirrors_helper' not found"); |
| 53 Expect.stringEquals("mirrors_helper", helperLibrary.simpleName, | 53 Expect.stringEquals("mirrors_helper", helperLibrary.simpleName, |
| 54 "Unexpected library simple name"); | 54 "Unexpected library simple name"); |
| 55 Expect.stringEquals("mirrors_helper", helperLibrary.qualifiedName, | 55 Expect.stringEquals("mirrors_helper", helperLibrary.qualifiedName, |
| 56 "Unexpected library qualified name"); | 56 "Unexpected library qualified name"); |
| 57 | 57 |
| 58 var helperLibraryLocation = helperLibrary.location; |
| 59 Expect.isNotNull(helperLibraryLocation); |
| 60 Expect.equals(271, helperLibraryLocation.offset, "Unexpected offset"); |
| 61 Expect.equals(23, helperLibraryLocation.length, "Unexpected length"); |
| 62 Expect.equals(9, helperLibraryLocation.line, "Unexpected line"); |
| 63 Expect.equals(1, helperLibraryLocation.column, "Unexpected column"); |
| 64 |
| 65 |
| 58 var classes = helperLibrary.classes; | 66 var classes = helperLibrary.classes; |
| 59 Expect.isNotNull(classes, "No classes map returned"); | 67 Expect.isNotNull(classes, "No classes map returned"); |
| 60 Expect.isFalse(classes.isEmpty, "Empty classes map returned"); | 68 Expect.isFalse(classes.isEmpty, "Empty classes map returned"); |
| 61 | 69 |
| 62 testFoo(mirrors, helperLibrary, classes); | 70 testFoo(mirrors, helperLibrary, classes); |
| 63 testBar(mirrors, helperLibrary, classes); | 71 testBar(mirrors, helperLibrary, classes); |
| 64 testBaz(mirrors, helperLibrary, classes); | 72 testBaz(mirrors, helperLibrary, classes); |
| 65 // TODO(johnniwinther): Add test of class [Boz] and typedef [Func]. | 73 // TODO(johnniwinther): Add test of class [Boz] and typedef [Func]. |
| 66 // TODO(johnniwinther): Add tests of type argument substitution, which | 74 // TODO(johnniwinther): Add tests of type argument substitution, which |
| 67 // is not currently implemented in dart2js. | 75 // is not currently implemented in dart2js. |
| (...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 privateClass.members['_PrivateClass._privateFactoryConstructor']; | 779 privateClass.members['_PrivateClass._privateFactoryConstructor']; |
| 772 Expect.isNotNull(privateFactoryConstructor); | 780 Expect.isNotNull(privateFactoryConstructor); |
| 773 Expect.isTrue(privateFactoryConstructor is MethodMirror); | 781 Expect.isTrue(privateFactoryConstructor is MethodMirror); |
| 774 Expect.isTrue(privateFactoryConstructor.isConstructor); | 782 Expect.isTrue(privateFactoryConstructor.isConstructor); |
| 775 Expect.isTrue(privateFactoryConstructor.isPrivate); | 783 Expect.isTrue(privateFactoryConstructor.isPrivate); |
| 776 Expect.isFalse(privateFactoryConstructor.isConstConstructor); | 784 Expect.isFalse(privateFactoryConstructor.isConstConstructor); |
| 777 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); | 785 Expect.isFalse(privateFactoryConstructor.isRedirectingConstructor); |
| 778 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); | 786 Expect.isFalse(privateFactoryConstructor.isGenerativeConstructor); |
| 779 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); | 787 Expect.isTrue(privateFactoryConstructor.isFactoryConstructor); |
| 780 } | 788 } |
| OLD | NEW |