| 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 library engine.resolver_test; | 5 library engine.resolver_test; |
| 6 | 6 |
| 7 import 'dart:collection'; | 7 import 'dart:collection'; |
| 8 | 8 |
| 9 import 'package:analyzer/src/generated/ast.dart'; | 9 import 'package:analyzer/src/generated/ast.dart'; |
| 10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
| (...skipping 8641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8652 | 8652 |
| 8653 void test_entryPoint_none() { | 8653 void test_entryPoint_none() { |
| 8654 Source source = addNamedSource("/one.dart", "library one;"); | 8654 Source source = addNamedSource("/one.dart", "library one;"); |
| 8655 LibraryElement library = resolve(source); | 8655 LibraryElement library = resolve(source); |
| 8656 expect(library, isNotNull); | 8656 expect(library, isNotNull); |
| 8657 expect(library.entryPoint, isNull); | 8657 expect(library.entryPoint, isNull); |
| 8658 assertNoErrors(source); | 8658 assertNoErrors(source); |
| 8659 verify([source]); | 8659 verify([source]); |
| 8660 } | 8660 } |
| 8661 | 8661 |
| 8662 void test_enum_externalLibrary() { |
| 8663 resetWithEnum(); |
| 8664 addNamedSource("/my_lib.dart", r''' |
| 8665 library my_lib; |
| 8666 enum EEE {A, B, C}'''); |
| 8667 Source source = addSource(r''' |
| 8668 import 'my_lib.dart'; |
| 8669 main() { |
| 8670 EEE e = null; |
| 8671 }'''); |
| 8672 resolve(source); |
| 8673 assertNoErrors(source); |
| 8674 verify([source]); |
| 8675 } |
| 8676 |
| 8662 void test_extractedMethodAsConstant() { | 8677 void test_extractedMethodAsConstant() { |
| 8663 Source source = addSource(r''' | 8678 Source source = addSource(r''' |
| 8664 abstract class Comparable<T> { | 8679 abstract class Comparable<T> { |
| 8665 int compareTo(T other); | 8680 int compareTo(T other); |
| 8666 static int compare(Comparable a, Comparable b) => a.compareTo(b); | 8681 static int compare(Comparable a, Comparable b) => a.compareTo(b); |
| 8667 } | 8682 } |
| 8668 class A { | 8683 class A { |
| 8669 void sort([compare = Comparable.compare]) {} | 8684 void sort([compare = Comparable.compare]) {} |
| 8670 }'''); | 8685 }'''); |
| 8671 resolve(source); | 8686 resolve(source); |
| (...skipping 5129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13801 // check propagated type | 13816 // check propagated type |
| 13802 FunctionType propagatedType = node.propagatedType as FunctionType; | 13817 FunctionType propagatedType = node.propagatedType as FunctionType; |
| 13803 expect(propagatedType.returnType, test.typeProvider.stringType); | 13818 expect(propagatedType.returnType, test.typeProvider.stringType); |
| 13804 } on AnalysisException catch (e, stackTrace) { | 13819 } on AnalysisException catch (e, stackTrace) { |
| 13805 thrownException[0] = new CaughtException(e, stackTrace); | 13820 thrownException[0] = new CaughtException(e, stackTrace); |
| 13806 } | 13821 } |
| 13807 } | 13822 } |
| 13808 return null; | 13823 return null; |
| 13809 } | 13824 } |
| 13810 } | 13825 } |
| OLD | NEW |