Index: pkg/analysis_server/test/services/correction/assist_test.dart |
diff --git a/pkg/analysis_server/test/services/correction/assist_test.dart b/pkg/analysis_server/test/services/correction/assist_test.dart |
index c40acb1348b40d063d53ef53537aa4e4325b0d04..d3c11d0ddfd3e3c08d7d2994c5f8f8e3824436f0 100644 |
--- a/pkg/analysis_server/test/services/correction/assist_test.dart |
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart |
@@ -12,13 +12,11 @@ import 'package:unittest/unittest.dart'; |
import '../../abstract_single_unit.dart'; |
import '../../reflective_tests.dart'; |
- |
main() { |
groupSep = ' | '; |
runReflectiveTests(AssistProcessorTest); |
} |
- |
@reflectiveTest |
class AssistProcessorTest extends AbstractSingleUnitTest { |
int offset; |
@@ -47,8 +45,8 @@ class AssistProcessorTest extends AbstractSingleUnitTest { |
/** |
* Calls [assertHasAssist] at the offset of [offsetSearch] in [testCode]. |
*/ |
- void assertHasAssistAt(String offsetSearch, AssistKind kind, |
- String expected) { |
+ void assertHasAssistAt( |
+ String offsetSearch, AssistKind kind, String expected) { |
offset = findOffset(offsetSearch); |
assertHasAssist(kind, expected); |
} |
@@ -86,8 +84,8 @@ class AssistProcessorTest extends AbstractSingleUnitTest { |
return positions; |
} |
- List<LinkedEditSuggestion> expectedSuggestions(LinkedEditSuggestionKind kind, |
- List<String> values) { |
+ List<LinkedEditSuggestion> expectedSuggestions( |
+ LinkedEditSuggestionKind kind, List<String> values) { |
return values.map((value) { |
return new LinkedEditSuggestion(value, kind); |
}).toList(); |
@@ -595,12 +593,10 @@ main() { |
} |
List<int> readBytes() => <int>[]; |
'''); |
- _assertLinkedGroup( |
- change.linkedEditGroups[0], |
- ['readBytes = '], |
- expectedSuggestions( |
- LinkedEditSuggestionKind.VARIABLE, |
- ['list', 'bytes2', 'readBytes'])); |
+ _assertLinkedGroup(change.linkedEditGroups[0], [ |
+ 'readBytes = ' |
+ ], expectedSuggestions( |
+ LinkedEditSuggestionKind.VARIABLE, ['list', 'bytes2', 'readBytes'])); |
} |
void test_assignToLocalVariable_alreadyAssignment() { |
@@ -789,9 +785,7 @@ class A { |
} |
} |
'''); |
- assertHasAssistAt( |
- '{ // marker', |
- AssistKind.CONVERT_INTO_EXPRESSION_BODY, |
+ assertHasAssistAt('{ // marker', AssistKind.CONVERT_INTO_EXPRESSION_BODY, |
''' |
class A { |
m() => 42; |
@@ -1142,8 +1136,7 @@ main() { |
'''); |
} |
- void |
- test_exchangeBinaryExpressionArguments_OK_extended_sameOperator_afterFirst() { |
+ void test_exchangeBinaryExpressionArguments_OK_extended_sameOperator_afterFirst() { |
resolveTestUnit(''' |
main() { |
1 + 2 + 3; |
@@ -1156,8 +1149,7 @@ main() { |
'''); |
} |
- void |
- test_exchangeBinaryExpressionArguments_OK_extended_sameOperator_afterSecond() { |
+ void test_exchangeBinaryExpressionArguments_OK_extended_sameOperator_afterSecond() { |
resolveTestUnit(''' |
main() { |
1 + 2 + 3; |
@@ -1372,15 +1364,11 @@ main(p) { |
} |
'''; |
assertHasAssistAt( |
- 'is MyType', |
- AssistKind.INTRODUCE_LOCAL_CAST_TYPE, |
- expected); |
- _assertLinkedGroup( |
- change.linkedEditGroups[0], |
- ['myTypeName = '], |
- expectedSuggestions( |
- LinkedEditSuggestionKind.VARIABLE, |
- ['myTypeName', 'typeName', 'name'])); |
+ 'is MyType', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected); |
+ _assertLinkedGroup(change.linkedEditGroups[0], [ |
+ 'myTypeName = ' |
+ ], expectedSuggestions( |
+ LinkedEditSuggestionKind.VARIABLE, ['myTypeName', 'typeName', 'name'])); |
// another good location |
assertHasAssistAt('if (p', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected); |
} |
@@ -1402,13 +1390,9 @@ main(p) { |
} |
'''; |
assertHasAssistAt( |
- 'is String', |
- AssistKind.INTRODUCE_LOCAL_CAST_TYPE, |
- expected); |
+ 'is String', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected); |
assertHasAssistAt( |
- 'while (p', |
- AssistKind.INTRODUCE_LOCAL_CAST_TYPE, |
- expected); |
+ 'while (p', AssistKind.INTRODUCE_LOCAL_CAST_TYPE, expected); |
} |
void test_invalidSelection() { |
@@ -2028,8 +2012,7 @@ main() { |
assertNoAssistAt('v;', AssistKind.JOIN_VARIABLE_DECLARATION); |
} |
- void |
- test_joinVariableDeclaration_onDeclaration_wrong_nextNotAssignmentExpression() { |
+ void test_joinVariableDeclaration_onDeclaration_wrong_nextNotAssignmentExpression() { |
resolveTestUnit(''' |
main() { |
var v; |
@@ -2039,8 +2022,7 @@ main() { |
assertNoAssistAt('v;', AssistKind.JOIN_VARIABLE_DECLARATION); |
} |
- void |
- test_joinVariableDeclaration_onDeclaration_wrong_nextNotExpressionStatement() { |
+ void test_joinVariableDeclaration_onDeclaration_wrong_nextNotExpressionStatement() { |
resolveTestUnit(''' |
main() { |
var v; |
@@ -2050,8 +2032,7 @@ main() { |
assertNoAssistAt('v;', AssistKind.JOIN_VARIABLE_DECLARATION); |
} |
- void |
- test_joinVariableDeclaration_onDeclaration_wrong_nextNotPureAssignment() { |
+ void test_joinVariableDeclaration_onDeclaration_wrong_nextNotPureAssignment() { |
resolveTestUnit(''' |
main() { |
var v; |
@@ -2143,9 +2124,7 @@ main() { |
return true ? 111 : 222; |
} |
'''); |
- assertHasAssistAt( |
- 'return ', |
- AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, |
+ assertHasAssistAt('return ', AssistKind.REPLACE_CONDITIONAL_WITH_IF_ELSE, |
''' |
main() { |
if (true) { |
@@ -2202,9 +2181,7 @@ main() { |
} |
} |
'''); |
- assertHasAssistAt( |
- 'if (true)', |
- AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, |
+ assertHasAssistAt('if (true)', AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, |
''' |
main() { |
int vvv; |
@@ -2223,9 +2200,7 @@ main() { |
} |
} |
'''); |
- assertHasAssistAt( |
- 'if (true)', |
- AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, |
+ assertHasAssistAt('if (true)', AssistKind.REPLACE_IF_ELSE_WITH_CONDITIONAL, |
''' |
main() { |
return true ? 111 : 222; |