| 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 }); | 17 }); |
| 18 } | 18 } |
| 19 | 19 |
| 20 @reflectiveTest | 20 @reflectiveTest |
| 21 class LabelContributorTest extends DartCompletionContributorTest { | 21 class LabelContributorTest extends DartCompletionContributorTest { |
| 22 @override | |
| 23 bool get enableNewAnalysisDriver => true; | |
| 24 | |
| 25 CompletionSuggestion assertSuggestLabel(String name, | 22 CompletionSuggestion assertSuggestLabel(String name, |
| 26 {int relevance: DART_RELEVANCE_DEFAULT, | 23 {int relevance: DART_RELEVANCE_DEFAULT, |
| 27 CompletionSuggestionKind kind: CompletionSuggestionKind.IDENTIFIER}) { | 24 CompletionSuggestionKind kind: CompletionSuggestionKind.IDENTIFIER}) { |
| 28 CompletionSuggestion cs = | 25 CompletionSuggestion cs = |
| 29 assertSuggest(name, csKind: kind, relevance: relevance); | 26 assertSuggest(name, csKind: kind, relevance: relevance); |
| 30 expect(cs.returnType, isNull); | 27 expect(cs.returnType, isNull); |
| 31 Element element = cs.element; | 28 Element element = cs.element; |
| 32 expect(element, isNotNull); | 29 expect(element, isNotNull); |
| 33 expect(element.flags, 0); | 30 expect(element.flags, 0); |
| 34 expect(element.kind, equals(ElementKind.LABEL)); | 31 expect(element.kind, equals(ElementKind.LABEL)); |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 break; | 312 break; |
| 316 foo: case 2: | 313 foo: case 2: |
| 317 continue ^; | 314 continue ^; |
| 318 case 3: | 315 case 3: |
| 319 break; | 316 break; |
| 320 '''); | 317 '''); |
| 321 await computeSuggestions(); | 318 await computeSuggestions(); |
| 322 assertSuggestLabel('foo'); | 319 assertSuggestLabel('foo'); |
| 323 } | 320 } |
| 324 } | 321 } |
| OLD | NEW |