| 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 27e32b747fd0b7bf4e35fa73857799d1298674be..04ce497bc8ccbf4d22e71df7126e07f324a7cfa6 100644
|
| --- a/pkg/analysis_server/test/services/completion/optype_test.dart
|
| +++ b/pkg/analysis_server/test/services/completion/optype_test.dart
|
| @@ -1124,19 +1124,72 @@ class C2 {
|
| assertOpType(typeNames: true);
|
| }
|
|
|
| - test_SwitchCase() {
|
| + test_SwitchCase_before() {
|
| + // SwitchCase SwitchStatement Block
|
| + addTestSource('main() {switch(k) {^case 1:}}');
|
| + assertOpType();
|
| + }
|
| +
|
| + test_SwitchCase_between() {
|
| + // SwitchCase SwitchStatement Block
|
| + addTestSource('main() {switch(k) {case 1: ^ case 2: return}}');
|
| + assertOpType(returnValue: true, typeNames: true, voidReturn: true);
|
| + }
|
| +
|
| + test_SwitchCase_expression1() {
|
| // SimpleIdentifier SwitchCase SwitchStatement
|
| addTestSource('''m() {switch (x) {case ^D: return;}}''');
|
| - // TODO (danrubel) should refine this to return constants
|
| + assertOpType(returnValue: true, typeNames: true);
|
| + }
|
| +
|
| + test_SwitchCase_expression2() {
|
| + // SimpleIdentifier SwitchCase SwitchStatement
|
| + addTestSource('''m() {switch (x) {case ^}}''');
|
| + assertOpType(returnValue: true, typeNames: true);
|
| + }
|
| +
|
| + test_SwitchDefault_before() {
|
| + // SwitchDefault SwitchStatement Block
|
| + addTestSource('main() {switch(k) { ^ default: return;}}');
|
| + assertOpType();
|
| + }
|
| +
|
| + test_SwitchDefault_between() {
|
| + // SwitchDefault SwitchStatement Block
|
| + addTestSource('main() {switch(k) {case 1: ^ default: return;}}');
|
| + assertOpType(returnValue: true, typeNames: true, voidReturn: true);
|
| + }
|
| +
|
| + test_SwitchStatement_body_empty() {
|
| + // Token('}') SwitchStatement Block
|
| + addTestSource('main() {switch(k) {^}}');
|
| + assertOpType();
|
| + }
|
| +
|
| + test_SwitchStatement_body_end() {
|
| + // Token('}') SwitchStatement Block
|
| + addTestSource('main() {switch(k) {case 1:^}}');
|
| assertOpType(returnValue: true, typeNames: true, voidReturn: true);
|
| }
|
|
|
| - test_SwitchStatement() {
|
| + test_SwitchStatement_expression1() {
|
| // SimpleIdentifier SwitchStatement Block
|
| addTestSource('main() {switch(^k) {case 1:{}}}');
|
| assertOpType(returnValue: true, typeNames: true);
|
| }
|
|
|
| + test_SwitchStatement_expression2() {
|
| + // SimpleIdentifier SwitchStatement Block
|
| + addTestSource('main() {switch(k^) {case 1:{}}}');
|
| + assertOpType(returnValue: true, typeNames: true);
|
| + }
|
| +
|
| + test_SwitchStatement_expression_empty() {
|
| + // SimpleIdentifier SwitchStatement Block
|
| + addTestSource('main() {switch(^) {case 1:{}}}');
|
| + assertOpType(returnValue: true, typeNames: true);
|
| + }
|
| +
|
| test_ThisExpression_block() {
|
| // MethodInvocation ExpressionStatement Block
|
| addTestSource('''
|
|
|