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 test.services.completion.toplevel; | 5 library test.services.completion.toplevel; |
6 | 6 |
7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
8 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; | 8 import 'package:analysis_server/src/services/completion/completion_manager.dart'
; |
9 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; | 9 import 'package:analysis_server/src/services/completion/dart_completion_cache.da
rt'; |
10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 10 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
11 import 'package:analysis_server/src/services/completion/imported_computer.dart'; | 11 import 'package:analysis_server/src/services/completion/imported_computer.dart'; |
12 import 'package:analyzer/src/generated/ast.dart'; | 12 import 'package:analyzer/src/generated/ast.dart'; |
13 import 'package:analyzer/src/generated/element.dart'; | 13 import 'package:analyzer/src/generated/element.dart'; |
14 import 'package:analyzer/src/generated/engine.dart'; | 14 import 'package:analyzer/src/generated/engine.dart'; |
15 import 'package:analyzer/src/generated/source.dart'; | 15 import 'package:analyzer/src/generated/source.dart'; |
16 import 'package:unittest/unittest.dart'; | 16 import 'package:unittest/unittest.dart'; |
17 | 17 |
18 import '../../abstract_context.dart'; | 18 import '../../abstract_context.dart'; |
19 import '../../reflective_tests.dart'; | 19 import '../../reflective_tests.dart'; |
20 import 'completion_test_util.dart'; | 20 import 'completion_test_util.dart'; |
21 | 21 |
22 main() { | 22 main() { |
23 groupSep = ' | '; | 23 groupSep = ' | '; |
24 runReflectiveTests(ImportedComputerTest); | 24 runReflectiveTests(ImportedComputerTest); |
25 } | 25 } |
26 | 26 |
27 @ReflectiveTestCase() | 27 @reflectiveTest |
28 class ImportedComputerTest extends AbstractSelectorSuggestionTest { | 28 class ImportedComputerTest extends AbstractSelectorSuggestionTest { |
29 | 29 |
30 void assertCached(String completion) { | 30 void assertCached(String completion) { |
31 DartCompletionCache cache = request.cache; | 31 DartCompletionCache cache = request.cache; |
32 if (!isCached(cache.importedTypeSuggestions, completion) && | 32 if (!isCached(cache.importedTypeSuggestions, completion) && |
33 !isCached(cache.importedVoidReturnSuggestions, completion) && | 33 !isCached(cache.importedVoidReturnSuggestions, completion) && |
34 !isCached(cache.libraryPrefixSuggestions, completion) && | 34 !isCached(cache.libraryPrefixSuggestions, completion) && |
35 !isCached(cache.otherImportedSuggestions, completion)) { | 35 !isCached(cache.otherImportedSuggestions, completion)) { |
36 fail('expected $completion to be cached'); | 36 fail('expected $completion to be cached'); |
37 } | 37 } |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 | 588 |
589 @override | 589 @override |
590 test_partFile_TypeName2() { | 590 test_partFile_TypeName2() { |
591 return super.test_partFile_TypeName2().then((_) { | 591 return super.test_partFile_TypeName2().then((_) { |
592 expect( | 592 expect( |
593 request.cache.importKey, | 593 request.cache.importKey, |
594 'library libA;import "/testB.dart";part "/testA.dart";'); | 594 'library libA;import "/testB.dart";part "/testA.dart";'); |
595 }); | 595 }); |
596 } | 596 } |
597 } | 597 } |
OLD | NEW |