| 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/mirrors/mirrors.dart"); | 5 #import("../../../pkg/dartdoc/mirrors/mirrors.dart"); |
| 6 #import("../../../pkg/dartdoc/mirrors/mirrors_util.dart"); | 6 #import("../../../pkg/dartdoc/mirrors/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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 // class Baz<E,F extends Foo> implements Bar<E> { | 218 // class Baz<E,F extends Foo> implements Bar<E> { |
| 219 // Baz(); | 219 // Baz(); |
| 220 // const Baz.named(); | 220 // const Baz.named(); |
| 221 // factory Baz.factory() => new Baz<E,F>(); | 221 // factory Baz.factory() => new Baz<E,F>(); |
| 222 // | 222 // |
| 223 // static method1(e) {} | 223 // static method1(e) {} |
| 224 // void method2(E e, [F f = null]) {} | 224 // void method2(E e, [F f = null]) {} |
| 225 // Baz<E,F> method3(E func1(F f), Func<E,F> func2) => null; | 225 // Baz<E,F> method3(E func1(F f), Func<E,F> func2) => null; |
| 226 // | 226 // |
| 227 // bool operator==(Object other) => false; | 227 // bool operator==(Object other) => false; |
| 228 // int operator negate() => 0; | 228 // int operator -() => 0; |
| 229 // } | 229 // } |
| 230 void testBaz(MirrorSystem system, LibraryMirror helperLibrary, | 230 void testBaz(MirrorSystem system, LibraryMirror helperLibrary, |
| 231 Map<Object,TypeMirror> types) { | 231 Map<Object,TypeMirror> types) { |
| 232 var bazClass = findMirror(types, "Baz"); | 232 var bazClass = findMirror(types, "Baz"); |
| 233 Expect.isNotNull(bazClass, "Type 'Baz' not found"); | 233 Expect.isNotNull(bazClass, "Type 'Baz' not found"); |
| 234 Expect.isTrue(bazClass is InterfaceMirror, | 234 Expect.isTrue(bazClass is InterfaceMirror, |
| 235 "Unexpected mirror type returned"); | 235 "Unexpected mirror type returned"); |
| 236 Expect.stringEquals("Baz", bazClass.simpleName, | 236 Expect.stringEquals("Baz", bazClass.simpleName, |
| 237 "Unexpected type simple name"); | 237 "Unexpected type simple name"); |
| 238 Expect.stringEquals("mirrors_helper.Baz", bazClass.qualifiedName, | 238 Expect.stringEquals("mirrors_helper.Baz", bazClass.qualifiedName, |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 Expect.isFalse(operator_eq.isFactory, "Method is factory"); | 596 Expect.isFalse(operator_eq.isFactory, "Method is factory"); |
| 597 Expect.isNull(operator_eq.constructorName, | 597 Expect.isNull(operator_eq.constructorName, |
| 598 "Method constructorName is non-null"); | 598 "Method constructorName is non-null"); |
| 599 Expect.isFalse(operator_eq.isGetter, "Method is getter"); | 599 Expect.isFalse(operator_eq.isGetter, "Method is getter"); |
| 600 Expect.isFalse(operator_eq.isSetter, "Method is setter"); | 600 Expect.isFalse(operator_eq.isSetter, "Method is setter"); |
| 601 Expect.isTrue(operator_eq.isOperator, "Method is not operator"); | 601 Expect.isTrue(operator_eq.isOperator, "Method is not operator"); |
| 602 Expect.stringEquals('==', operator_eq.operatorName, | 602 Expect.stringEquals('==', operator_eq.operatorName, |
| 603 "Unexpected operatorName"); | 603 "Unexpected operatorName"); |
| 604 | 604 |
| 605 //////////////////////////////////////////////////////////////////////////// | 605 //////////////////////////////////////////////////////////////////////////// |
| 606 // int operator negate() => 0; | 606 // int operator -() => 0; |
| 607 //////////////////////////////////////////////////////////////////////////// | 607 //////////////////////////////////////////////////////////////////////////// |
| 608 var operator_negate = findMirror(bazClassMembers, "operator", | 608 var operator_negate = findMirror(bazClassMembers, "operator", |
| 609 operatorName: 'negate'); | 609 operatorName: 'negate'); |
| 610 Expect.isNotNull(operator_negate, "operator < not found"); | 610 Expect.isNotNull(operator_negate, "operator < not found"); |
| 611 Expect.stringEquals('operator', operator_negate.simpleName, | 611 Expect.stringEquals('operator', operator_negate.simpleName, |
| 612 "Unexpected method simpleName"); | 612 "Unexpected method simpleName"); |
| 613 Expect.stringEquals('mirrors_helper.Baz.operator negate', | 613 Expect.stringEquals('mirrors_helper.Baz.operator negate', |
| 614 operator_negate.qualifiedName, | 614 operator_negate.qualifiedName, |
| 615 "Unexpected method qualifiedName"); | 615 "Unexpected method qualifiedName"); |
| 616 Expect.equals(operator_negate.surroundingDeclaration, bazClass, | 616 Expect.equals(operator_negate.surroundingDeclaration, bazClass, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 633 Expect.stringEquals('negate', operator_negate.operatorName, | 633 Expect.stringEquals('negate', operator_negate.operatorName, |
| 634 "Unexpected operatorName"); | 634 "Unexpected operatorName"); |
| 635 | 635 |
| 636 | 636 |
| 637 var bazClassConstructors = bazClass.constructors; | 637 var bazClassConstructors = bazClass.constructors; |
| 638 Expect.isNotNull(bazClassConstructors, "Constructors map is null"); | 638 Expect.isNotNull(bazClassConstructors, "Constructors map is null"); |
| 639 Expect.equals(3, bazClassConstructors.length, | 639 Expect.equals(3, bazClassConstructors.length, |
| 640 "Unexpected number of constructors"); | 640 "Unexpected number of constructors"); |
| 641 // TODO(johnniwinther): Add tests of constructors. | 641 // TODO(johnniwinther): Add tests of constructors. |
| 642 } | 642 } |
| OLD | NEW |