| 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 import 'package:analysis_server/protocol/protocol_generated.dart'; | 5 import 'package:analysis_server/protocol/protocol_generated.dart'; |
| 6 import 'package:analysis_server/src/protocol_server.dart'; | 6 import 'package:analysis_server/src/protocol_server.dart'; |
| 7 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; | 7 import 'package:analysis_server/src/provisional/completion/dart/completion_dart.
dart'; |
| 8 import 'package:analysis_server/src/services/completion/dart/label_contributor.d
art'; | 8 import 'package:analysis_server/src/services/completion/dart/label_contributor.d
art'; |
| 9 import 'package:test/test.dart'; | 9 import 'package:test/test.dart'; |
| 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 10 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
| 11 | 11 |
| 12 import 'completion_contributor_util.dart'; | 12 import 'completion_contributor_util.dart'; |
| 13 | 13 |
| 14 main() { | 14 main() { |
| 15 defineReflectiveSuite(() { | 15 defineReflectiveSuite(() { |
| 16 defineReflectiveTests(LabelContributorTest); | 16 defineReflectiveTests(LabelContributorTest); |
| 17 defineReflectiveTests(LabelContributorTest_Driver); | |
| 18 }); | 17 }); |
| 19 } | 18 } |
| 20 | 19 |
| 21 @reflectiveTest | 20 @reflectiveTest |
| 22 class LabelContributorTest extends DartCompletionContributorTest { | 21 class LabelContributorTest extends DartCompletionContributorTest { |
| 22 @override |
| 23 bool get enableNewAnalysisDriver => true; |
| 24 |
| 23 CompletionSuggestion assertSuggestLabel(String name, | 25 CompletionSuggestion assertSuggestLabel(String name, |
| 24 {int relevance: DART_RELEVANCE_DEFAULT, | 26 {int relevance: DART_RELEVANCE_DEFAULT, |
| 25 CompletionSuggestionKind kind: CompletionSuggestionKind.IDENTIFIER}) { | 27 CompletionSuggestionKind kind: CompletionSuggestionKind.IDENTIFIER}) { |
| 26 CompletionSuggestion cs = | 28 CompletionSuggestion cs = |
| 27 assertSuggest(name, csKind: kind, relevance: relevance); | 29 assertSuggest(name, csKind: kind, relevance: relevance); |
| 28 expect(cs.returnType, isNull); | 30 expect(cs.returnType, isNull); |
| 29 Element element = cs.element; | 31 Element element = cs.element; |
| 30 expect(element, isNotNull); | 32 expect(element, isNotNull); |
| 31 expect(element.flags, 0); | 33 expect(element.flags, 0); |
| 32 expect(element.kind, equals(ElementKind.LABEL)); | 34 expect(element.kind, equals(ElementKind.LABEL)); |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 break; | 315 break; |
| 314 foo: case 2: | 316 foo: case 2: |
| 315 continue ^; | 317 continue ^; |
| 316 case 3: | 318 case 3: |
| 317 break; | 319 break; |
| 318 '''); | 320 '''); |
| 319 await computeSuggestions(); | 321 await computeSuggestions(); |
| 320 assertSuggestLabel('foo'); | 322 assertSuggestLabel('foo'); |
| 321 } | 323 } |
| 322 } | 324 } |
| 323 | |
| 324 @reflectiveTest | |
| 325 class LabelContributorTest_Driver extends LabelContributorTest { | |
| 326 @override | |
| 327 bool get enableNewAnalysisDriver => true; | |
| 328 } | |
| OLD | NEW |