| 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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 Expect.equals(2, bazClassTypeVariables.length, | 315 Expect.equals(2, bazClassTypeVariables.length, |
| 316 "Type variable list is not empty"); | 316 "Type variable list is not empty"); |
| 317 | 317 |
| 318 var bazE = bazClassTypeVariables[0]; | 318 var bazE = bazClassTypeVariables[0]; |
| 319 Expect.isNotNull(bazE, "Type variable is null"); | 319 Expect.isNotNull(bazE, "Type variable is null"); |
| 320 Expect.stringEquals('E', bazE.simpleName, "Unexpected simpleName"); | 320 Expect.stringEquals('E', bazE.simpleName, "Unexpected simpleName"); |
| 321 Expect.stringEquals('mirrors_helper.Baz.E', bazE.qualifiedName, | 321 Expect.stringEquals('mirrors_helper.Baz.E', bazE.qualifiedName, |
| 322 "Unexpected qualifiedName"); | 322 "Unexpected qualifiedName"); |
| 323 Expect.equals(bazClass, bazE.declarer, | 323 Expect.equals(bazClass, bazE.declarer, |
| 324 "Unexpected type variable declarer"); | 324 "Unexpected type variable declarer"); |
| 325 var bazEbound = bazE.bound; | 325 var bazEbound = bazE.upperBound; |
| 326 Expect.isNotNull(bazEbound, "Missing type variable bound"); | 326 Expect.isNotNull(bazEbound); |
| 327 Expect.isFalse(bazEbound.isOriginalDeclaration); | 327 Expect.isFalse(bazEbound.isOriginalDeclaration); |
| 328 Expect.isTrue(bazEbound.isObject, "Bound is not object"); | 328 Expect.isTrue(bazEbound.isObject, "Bound is not object"); |
| 329 | 329 |
| 330 var bazF = bazClassTypeVariables[1]; | 330 var bazF = bazClassTypeVariables[1]; |
| 331 Expect.isNotNull(bazF, "Type variable is null"); | 331 Expect.isNotNull(bazF, "Type variable is null"); |
| 332 Expect.stringEquals('F', bazF.simpleName, "Unexpected simpleName"); | 332 Expect.stringEquals('F', bazF.simpleName, "Unexpected simpleName"); |
| 333 Expect.stringEquals('mirrors_helper.Baz.F', bazF.qualifiedName, | 333 Expect.stringEquals('mirrors_helper.Baz.F', bazF.qualifiedName, |
| 334 "Unexpected qualifiedName"); | 334 "Unexpected qualifiedName"); |
| 335 Expect.equals(bazClass, bazF.declarer); | 335 Expect.equals(bazClass, bazF.declarer); |
| 336 var bazFbound = bazF.bound; | 336 var bazFbound = bazF.upperBound; |
| 337 Expect.isNotNull(bazFbound, "Missing type variable bound"); | 337 Expect.isNotNull(bazFbound); |
| 338 Expect.isFalse(bazFbound.isOriginalDeclaration); | 338 Expect.isFalse(bazFbound.isOriginalDeclaration); |
| 339 Expect.stringEquals("mirrors_helper.Foo", bazFbound.qualifiedName, | 339 Expect.stringEquals("mirrors_helper.Foo", bazFbound.qualifiedName, |
| 340 "Bound is not Foo"); | 340 "Bound is not Foo"); |
| 341 | 341 |
| 342 Expect.isNull(bazClass.defaultFactory); | 342 Expect.isNull(bazClass.defaultFactory); |
| 343 | 343 |
| 344 var bazClassMembers = bazClass.declaredMembers; | 344 var bazClassMembers = bazClass.declaredMembers; |
| 345 Expect.isNotNull(bazClassMembers, "Declared members map is null"); | 345 Expect.isNotNull(bazClassMembers, "Declared members map is null"); |
| 346 Expect.equals(8, bazClassMembers.length, | 346 Expect.equals(8, bazClassMembers.length, |
| 347 "Unexpected number of declared members"); | 347 "Unexpected number of declared members"); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 567 Expect.isNull(funcTypedef.defaultFactory); | 567 Expect.isNull(funcTypedef.defaultFactory); |
| 568 // TODO(johnniwinther): Should not throw an exception since the type should | 568 // TODO(johnniwinther): Should not throw an exception since the type should |
| 569 // not be the original declaration. | 569 // not be the original declaration. |
| 570 Expect.throws(() => funcTypedef.typeArguments, | 570 Expect.throws(() => funcTypedef.typeArguments, |
| 571 (exception) => true, | 571 (exception) => true, |
| 572 "Typedef has type arguments"); | 572 "Typedef has type arguments"); |
| 573 var funcTypedefTypeVariables = funcTypedef.typeVariables; | 573 var funcTypedefTypeVariables = funcTypedef.typeVariables; |
| 574 Expect.isNotNull(funcTypedefTypeVariables); | 574 Expect.isNotNull(funcTypedefTypeVariables); |
| 575 Expect.equals(2, funcTypedefTypeVariables.length); | 575 Expect.equals(2, funcTypedefTypeVariables.length); |
| 576 | 576 |
| 577 var funcTypedefDefinition = funcTypedef.definition; | 577 var funcTypedefDefinition = funcTypedef.value; |
| 578 Expect.isNotNull(funcTypedefDefinition); | 578 Expect.isNotNull(funcTypedefDefinition); |
| 579 Expect.isTrue(funcTypedefDefinition is FunctionTypeMirror); | 579 Expect.isTrue(funcTypedefDefinition is FunctionTypeMirror); |
| 580 | 580 |
| 581 Expect.stringEquals("func2", method3Parameter2.simpleName, | 581 Expect.stringEquals("func2", method3Parameter2.simpleName, |
| 582 "Unexpected parameter simpleName"); | 582 "Unexpected parameter simpleName"); |
| 583 Expect.stringEquals("mirrors_helper.Baz.method3#func2", | 583 Expect.stringEquals("mirrors_helper.Baz.method3#func2", |
| 584 method3Parameter2.qualifiedName, | 584 method3Parameter2.qualifiedName, |
| 585 "Unexpected parameter qualifiedName"); | 585 "Unexpected parameter qualifiedName"); |
| 586 Expect.isFalse(method3Parameter2.hasDefaultValue, | 586 Expect.isFalse(method3Parameter2.hasDefaultValue, |
| 587 "Parameter 'func2' has default value: " | 587 "Parameter 'func2' has default value: " |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 Expect.isTrue(privateConstructor.isConstructor); | 737 Expect.isTrue(privateConstructor.isConstructor); |
| 738 Expect.isTrue(privateConstructor.isPrivate); | 738 Expect.isTrue(privateConstructor.isPrivate); |
| 739 | 739 |
| 740 var privateFactoryConstructor = | 740 var privateFactoryConstructor = |
| 741 privateClass.declaredMembers['_PrivateClass._privateFactoryConstructor']; | 741 privateClass.declaredMembers['_PrivateClass._privateFactoryConstructor']; |
| 742 Expect.isNotNull(privateFactoryConstructor); | 742 Expect.isNotNull(privateFactoryConstructor); |
| 743 Expect.isTrue(privateFactoryConstructor is MethodMirror); | 743 Expect.isTrue(privateFactoryConstructor is MethodMirror); |
| 744 Expect.isTrue(privateFactoryConstructor.isFactory); | 744 Expect.isTrue(privateFactoryConstructor.isFactory); |
| 745 Expect.isTrue(privateFactoryConstructor.isPrivate); | 745 Expect.isTrue(privateFactoryConstructor.isPrivate); |
| 746 } | 746 } |
| OLD | NEW |