| Index: pkg/analysis_server/test/services/completion/optype_test.dart
|
| diff --git a/pkg/analysis_server/test/services/completion/optype_test.dart b/pkg/analysis_server/test/services/completion/optype_test.dart
|
| index 254695d2b6bc82c1170644c9b7a7271674902ef0..eb84c6ca50bb2fc358fc905050e4d12490ff03f9 100644
|
| --- a/pkg/analysis_server/test/services/completion/optype_test.dart
|
| +++ b/pkg/analysis_server/test/services/completion/optype_test.dart
|
| @@ -44,11 +44,12 @@ class OpTypeTest {
|
| }
|
|
|
| void assertOpType({bool invocation: false, bool returnValue: false,
|
| - bool typeNames: false, bool voidReturn: false}) {
|
| + bool typeNames: false, bool voidReturn: false, bool statementLabel: false}) {
|
| expect(visitor.includeInvocationSuggestions, equals(invocation));
|
| expect(visitor.includeReturnValueSuggestions, equals(returnValue));
|
| expect(visitor.includeTypeNameSuggestions, equals(typeNames));
|
| expect(visitor.includeVoidReturnSuggestions, equals(voidReturn));
|
| + expect(visitor.includeStatementLabelSuggestions, equals(statementLabel));
|
| }
|
|
|
| test_Annotation() {
|
| @@ -193,6 +194,21 @@ class OpTypeTest {
|
| assertOpType(returnValue: true, typeNames: true, voidReturn: true);
|
| }
|
|
|
| + test_Break_after_label() {
|
| + addTestSource('main() { foo: while (true) { break foo ^ ; } }');
|
| + assertOpType(/* No valid completions */);
|
| + }
|
| +
|
| + test_Break_before_label() {
|
| + addTestSource('main() { foo: while (true) { break ^ foo; } }');
|
| + assertOpType(statementLabel: true);
|
| + }
|
| +
|
| + test_Break_no_label() {
|
| + addTestSource('main() { foo: while (true) { break ^; } }');
|
| + assertOpType(statementLabel: true);
|
| + }
|
| +
|
| test_CascadeExpression_selector1() {
|
| // PropertyAccess CascadeExpression ExpressionStatement Block
|
| addTestSource('''
|
| @@ -307,6 +323,21 @@ class OpTypeTest {
|
| assertOpType(invocation: true);
|
| }
|
|
|
| + test_Continue_after_label() {
|
| + addTestSource('main() { foo: while (true) { continue foo ^ ; } }');
|
| + assertOpType(/* No valid completions */);
|
| + }
|
| +
|
| + test_Continue_before_label() {
|
| + addTestSource('main() { foo: while (true) { continue ^ foo; } }');
|
| + assertOpType(statementLabel: true);
|
| + }
|
| +
|
| + test_Continue_no_label() {
|
| + addTestSource('main() { foo: while (true) { continue ^; } }');
|
| + assertOpType(statementLabel: true);
|
| + }
|
| +
|
| test_DoStatement() {
|
| // SimpleIdentifier DoStatement Block
|
| addTestSource('main() {do{} while(^x);}');
|
|
|