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 d3ff65dd97abadfe4a41c833c67b0ea8f9f7a175..efd355e5af3d5e1d390e099a12ec5ef5f2d5b156 100644 |
--- a/pkg/analysis_server/test/services/completion/optype_test.dart |
+++ b/pkg/analysis_server/test/services/completion/optype_test.dart |
@@ -43,19 +43,27 @@ class OpTypeTest { |
visitor = new OpType.forCompletion(completionTarget, offset); |
} |
- void assertOpType({bool prefixed: false, bool returnValue: false, |
- bool typeNames: false, bool voidReturn: false, bool statementLabel: false, |
- bool caseLabel: false, bool constructors: false}) { |
+ void assertOpType( |
+ {bool caseLabel: false, |
+ bool constructors: false, |
+ bool prefixed: false, |
+ bool returnValue: false, |
+ bool statementLabel: false, |
+ bool staticMethodBody: false, |
+ bool typeNames: false, |
+ bool voidReturn: false}) { |
+ expect(visitor.includeCaseLabelSuggestions, caseLabel, reason: 'caseLabel'); |
+ expect(visitor.includeConstructorSuggestions, constructors, |
+ reason: 'constructors'); |
expect(visitor.includeReturnValueSuggestions, returnValue, |
reason: 'returnValue'); |
+ expect(visitor.includeStatementLabelSuggestions, statementLabel, |
+ reason: 'statementLabel'); |
expect(visitor.includeTypeNameSuggestions, typeNames, reason: 'typeNames'); |
expect(visitor.includeVoidReturnSuggestions, voidReturn, |
reason: 'voidReturn'); |
- expect(visitor.includeStatementLabelSuggestions, statementLabel, |
- reason: 'statementLabel'); |
- expect(visitor.includeCaseLabelSuggestions, caseLabel, reason: 'caseLabel'); |
- expect(visitor.includeConstructorSuggestions, constructors, |
- reason: 'constructors'); |
+ expect(visitor.inStaticMethodBody, staticMethodBody, |
+ reason: 'staticMethodBody'); |
expect(visitor.isPrefixed, prefixed, reason: 'prefixed'); |
} |
@@ -244,6 +252,15 @@ class OpTypeTest { |
prefixed: true, returnValue: true, typeNames: true, voidReturn: true); |
} |
+ test_Block_static() { |
+ addTestSource('class A {static foo() {^}}'); |
+ assertOpType( |
+ returnValue: true, |
+ typeNames: true, |
+ staticMethodBody: true, |
+ voidReturn: true); |
+ } |
+ |
test_Break_after_label() { |
addTestSource('main() { foo: while (true) { break foo ^ ; } }'); |
assertOpType(/* No valid completions */); |