OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.task.dart_test; | 5 library test.src.task.dart_test; |
6 | 6 |
7 import 'package:analyzer/src/context/cache.dart'; | 7 import 'package:analyzer/src/context/cache.dart'; |
8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
9 import 'package:analyzer/src/generated/constant.dart'; | 9 import 'package:analyzer/src/generated/constant.dart'; |
10 import 'package:analyzer/src/generated/element.dart'; | 10 import 'package:analyzer/src/generated/element.dart'; |
(...skipping 2895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2906 expect(outputs[EXPORTED_LIBRARIES], hasLength(0)); | 2906 expect(outputs[EXPORTED_LIBRARIES], hasLength(0)); |
2907 _assertHasCore(outputs[IMPORTED_LIBRARIES], 1); | 2907 _assertHasCore(outputs[IMPORTED_LIBRARIES], 1); |
2908 expect(outputs[INCLUDED_PARTS], hasLength(0)); | 2908 expect(outputs[INCLUDED_PARTS], hasLength(0)); |
2909 expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(1)); | 2909 expect(outputs[LIBRARY_SPECIFIC_UNITS], hasLength(1)); |
2910 expect(outputs[PARSE_ERRORS], hasLength(0)); | 2910 expect(outputs[PARSE_ERRORS], hasLength(0)); |
2911 expect(outputs[PARSED_UNIT], isNotNull); | 2911 expect(outputs[PARSED_UNIT], isNotNull); |
2912 expect(outputs[SOURCE_KIND], SourceKind.UNKNOWN); | 2912 expect(outputs[SOURCE_KIND], SourceKind.UNKNOWN); |
2913 expect(outputs[UNITS], hasLength(1)); | 2913 expect(outputs[UNITS], hasLength(1)); |
2914 } | 2914 } |
2915 | 2915 |
| 2916 test_perform_flushTokenStream() { |
| 2917 _performParseTask(r''' |
| 2918 class Test {} |
| 2919 '''); |
| 2920 expect(analysisCache.getState(source, TOKEN_STREAM), CacheState.FLUSHED); |
| 2921 } |
| 2922 |
2916 test_perform_invalidDirectives() { | 2923 test_perform_invalidDirectives() { |
2917 _performParseTask(r''' | 2924 _performParseTask(r''' |
2918 library lib; | 2925 library lib; |
2919 import '/does/not/exist.dart'; | 2926 import '/does/not/exist.dart'; |
2920 import '://invaliduri.dart'; | 2927 import '://invaliduri.dart'; |
2921 export '${a}lib3.dart'; | 2928 export '${a}lib3.dart'; |
2922 part 'part.dart'; | 2929 part 'part.dart'; |
2923 class A {}'''); | 2930 class A {}'''); |
2924 expect(outputs, hasLength(9)); | 2931 expect(outputs, hasLength(9)); |
2925 expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(1)); | 2932 expect(outputs[EXPLICITLY_IMPORTED_LIBRARIES], hasLength(1)); |
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4585 /** | 4592 /** |
4586 * Fill [errorListener] with [result] errors in the current [task]. | 4593 * Fill [errorListener] with [result] errors in the current [task]. |
4587 */ | 4594 */ |
4588 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { | 4595 void _fillErrorListener(ResultDescriptor<List<AnalysisError>> result) { |
4589 List<AnalysisError> errors = task.outputs[result]; | 4596 List<AnalysisError> errors = task.outputs[result]; |
4590 expect(errors, isNotNull, reason: result.name); | 4597 expect(errors, isNotNull, reason: result.name); |
4591 errorListener = new GatheringErrorListener(); | 4598 errorListener = new GatheringErrorListener(); |
4592 errorListener.addAll(errors); | 4599 errorListener.addAll(errors); |
4593 } | 4600 } |
4594 } | 4601 } |
OLD | NEW |