| 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("../../../lib/dartdoc/mirrors/mirrors.dart"); | 5 #import("../../../lib/dartdoc/mirrors/mirrors.dart"); |
| 6 #import("../../../lib/dartdoc/mirrors/mirrors_util.dart"); | 6 #import("../../../lib/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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 274 } |
| 275 | 275 |
| 276 var bazSubdeclarations = computeSubdeclarations(bazClass); | 276 var bazSubdeclarations = computeSubdeclarations(bazClass); |
| 277 Expect.equals(0, count(bazSubdeclarations), "Unexpected subtype count"); | 277 Expect.equals(0, count(bazSubdeclarations), "Unexpected subtype count"); |
| 278 | 278 |
| 279 var barInterface = findMirror(bazInterfaces, "Bar"); | 279 var barInterface = findMirror(bazInterfaces, "Bar"); |
| 280 Expect.isNotNull(barInterface, "Interface bar is missing"); | 280 Expect.isNotNull(barInterface, "Interface bar is missing"); |
| 281 Expect.isFalse(barInterface.isDeclaration, "Interface type is declaration"); | 281 Expect.isFalse(barInterface.isDeclaration, "Interface type is declaration"); |
| 282 var barInterfaceTypeArguments = barInterface.typeArguments(); | 282 var barInterfaceTypeArguments = barInterface.typeArguments(); |
| 283 Expect.isNotNull(barInterfaceTypeArguments, "Type arguments are missing"); | 283 Expect.isNotNull(barInterfaceTypeArguments, "Type arguments are missing"); |
| 284 // TODO(johnniwinther): Ensure type arguments on supertypes. Expected result | 284 Expect.equals(1, barInterfaceTypeArguments.length, |
| 285 // should have been 1: | |
| 286 Expect.equals(0, barInterfaceTypeArguments.length, | |
| 287 "Type arguments is empty"); | 285 "Type arguments is empty"); |
| 288 | 286 |
| 289 Expect.throws(() => bazClass.typeArguments(), | 287 Expect.throws(() => bazClass.typeArguments(), |
| 290 (exception) => true, | 288 (exception) => true, |
| 291 "Class has type arguments"); | 289 "Class has type arguments"); |
| 292 var bazClassTypeVariables = bazClass.typeVariables(); | 290 var bazClassTypeVariables = bazClass.typeVariables(); |
| 293 Expect.isNotNull(bazClassTypeVariables, "Type variable list is null"); | 291 Expect.isNotNull(bazClassTypeVariables, "Type variable list is null"); |
| 294 Expect.equals(2, bazClassTypeVariables.length, | 292 Expect.equals(2, bazClassTypeVariables.length, |
| 295 "Type variable list is not empty"); | 293 "Type variable list is not empty"); |
| 296 | 294 |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 628 Expect.stringEquals('negate', operator_negate.operatorName, | 626 Expect.stringEquals('negate', operator_negate.operatorName, |
| 629 "Unexpected operatorName"); | 627 "Unexpected operatorName"); |
| 630 | 628 |
| 631 | 629 |
| 632 var bazClassConstructors = bazClass.constructors(); | 630 var bazClassConstructors = bazClass.constructors(); |
| 633 Expect.isNotNull(bazClassConstructors, "Constructors map is null"); | 631 Expect.isNotNull(bazClassConstructors, "Constructors map is null"); |
| 634 Expect.equals(3, bazClassConstructors.length, | 632 Expect.equals(3, bazClassConstructors.length, |
| 635 "Unexpected number of constructors"); | 633 "Unexpected number of constructors"); |
| 636 // TODO(johnniwinther): Add tests of constructors. | 634 // TODO(johnniwinther): Add tests of constructors. |
| 637 } | 635 } |
| OLD | NEW |