Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine.element_test; | 8 library engine.element_test; |
| 9 | 9 |
| 10 import 'package:analyzer/src/generated/ast.dart'; | 10 import 'package:analyzer/src/generated/ast.dart'; |
| (...skipping 2532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2543 | 2543 |
| 2544 void test_getMethod_unimplemented() { | 2544 void test_getMethod_unimplemented() { |
| 2545 // | 2545 // |
| 2546 // class A {} | 2546 // class A {} |
| 2547 // | 2547 // |
| 2548 ClassElementImpl classA = ElementFactory.classElement2("A"); | 2548 ClassElementImpl classA = ElementFactory.classElement2("A"); |
| 2549 InterfaceType typeA = classA.type; | 2549 InterfaceType typeA = classA.type; |
| 2550 expect(typeA.getMethod("m"), isNull); | 2550 expect(typeA.getMethod("m"), isNull); |
| 2551 } | 2551 } |
| 2552 | 2552 |
| 2553 void test_getConstructors() { | |
| 2554 // TODO | |
|
Brian Wilkerson
2015/05/13 16:10:45
Is this left over?
| |
| 2555 ClassElementImpl typeElement = ElementFactory.classElement2("A"); | |
| 2556 ConstructorElementImpl constructorOne = | |
| 2557 ElementFactory.constructorElement(typeElement, 'one', false); | |
| 2558 ConstructorElementImpl constructorTwo = | |
| 2559 ElementFactory.constructorElement(typeElement, 'two', false); | |
| 2560 typeElement.constructors = <ConstructorElement>[ | |
| 2561 constructorOne, | |
| 2562 constructorTwo | |
| 2563 ]; | |
| 2564 InterfaceTypeImpl type = new InterfaceTypeImpl(typeElement); | |
| 2565 expect(type.constructors, hasLength(2)); | |
| 2566 } | |
| 2567 | |
| 2553 void test_getMethods() { | 2568 void test_getMethods() { |
| 2554 ClassElementImpl typeElement = ElementFactory.classElement2("A"); | 2569 ClassElementImpl typeElement = ElementFactory.classElement2("A"); |
| 2555 MethodElementImpl methodOne = ElementFactory.methodElement("one", null); | 2570 MethodElementImpl methodOne = ElementFactory.methodElement("one", null); |
| 2556 MethodElementImpl methodTwo = ElementFactory.methodElement("two", null); | 2571 MethodElementImpl methodTwo = ElementFactory.methodElement("two", null); |
| 2557 typeElement.methods = <MethodElement>[methodOne, methodTwo]; | 2572 typeElement.methods = <MethodElement>[methodOne, methodTwo]; |
| 2558 InterfaceTypeImpl type = new InterfaceTypeImpl(typeElement); | 2573 InterfaceTypeImpl type = new InterfaceTypeImpl(typeElement); |
| 2559 expect(type.methods.length, 2); | 2574 expect(type.methods.length, 2); |
| 2560 } | 2575 } |
| 2561 | 2576 |
| 2562 void test_getMethods_empty() { | 2577 void test_getMethods_empty() { |
| 2563 ClassElementImpl typeElement = ElementFactory.classElement2("A"); | 2578 ClassElementImpl typeElement = ElementFactory.classElement2("A"); |
| 2564 InterfaceTypeImpl type = new InterfaceTypeImpl(typeElement); | 2579 InterfaceTypeImpl type = new InterfaceTypeImpl(typeElement); |
| 2565 expect(type.methods.length, 0); | 2580 expect(type.methods.length, 0); |
| 2566 } | 2581 } |
| 2567 | 2582 |
| 2583 void test_getConstructors_empty() { | |
| 2584 ClassElementImpl typeElement = ElementFactory.classElement2("A"); | |
| 2585 InterfaceTypeImpl type = new InterfaceTypeImpl(typeElement); | |
| 2586 expect(type.constructors, isEmpty); | |
| 2587 } | |
| 2588 | |
| 2568 void test_getMixins_nonParameterized() { | 2589 void test_getMixins_nonParameterized() { |
| 2569 // | 2590 // |
| 2570 // class C extends Object with A, B | 2591 // class C extends Object with A, B |
| 2571 // | 2592 // |
| 2572 ClassElementImpl classA = ElementFactory.classElement2("A"); | 2593 ClassElementImpl classA = ElementFactory.classElement2("A"); |
| 2573 InterfaceType typeA = classA.type; | 2594 InterfaceType typeA = classA.type; |
| 2574 ClassElementImpl classB = ElementFactory.classElement2("B"); | 2595 ClassElementImpl classB = ElementFactory.classElement2("B"); |
| 2575 InterfaceType typeB = classB.type; | 2596 InterfaceType typeB = classB.type; |
| 2576 ClassElementImpl classC = ElementFactory.classElement2("C"); | 2597 ClassElementImpl classC = ElementFactory.classElement2("C"); |
| 2577 classC.mixins = <InterfaceType>[typeA, typeB]; | 2598 classC.mixins = <InterfaceType>[typeA, typeB]; |
| (...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3959 } | 3980 } |
| 3960 | 3981 |
| 3961 class _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction | 3982 class _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction |
| 3962 extends InterfaceTypeImpl { | 3983 extends InterfaceTypeImpl { |
| 3963 _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction(ClassElement arg0) | 3984 _FunctionTypeImplTest_isSubtypeOf_baseCase_classFunction(ClassElement arg0) |
| 3964 : super(arg0); | 3985 : super(arg0); |
| 3965 | 3986 |
| 3966 @override | 3987 @override |
| 3967 bool get isDartCoreFunction => true; | 3988 bool get isDartCoreFunction => true; |
| 3968 } | 3989 } |
| OLD | NEW |