Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(408)

Unified Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 805053003: Disable 'Split && condition' if there is an 'else' statement. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 073a0c62c33a5df0358573e26af80d6686b402b6..cac20900ccd74a5b2f61d558768b126b0f100937 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -2220,35 +2220,6 @@ main() {
''');
}
- void test_splitAndCondition_OK_thenBlock_elseBlock() {
- _indexTestUnit('''
-main() {
- if (true && false) {
- print(0);
- } else {
- print(1);
- if (2 == 2) {
- print(2);
- }
- }
-}
-''');
- assertHasAssistAt('&& false', AssistKind.SPLIT_AND_CONDITION, '''
-main() {
- if (true) {
- if (false) {
- print(0);
- } else {
- print(1);
- if (2 == 2) {
- print(2);
- }
- }
- }
-}
-''');
- }
-
void test_splitAndCondition_OK_thenStatement() {
_indexTestUnit('''
main() {
@@ -2265,26 +2236,6 @@ main() {
''');
}
- void test_splitAndCondition_OK_thenStatement_elseStatement() {
- _indexTestUnit('''
-main() {
- if (true && false)
- print(0);
- else
- print(1);
-}
-''');
- assertHasAssistAt('&& false', AssistKind.SPLIT_AND_CONDITION, '''
-main() {
- if (true)
- if (false)
- print(0);
- else
- print(1);
-}
-''');
- }
-
void test_splitAndCondition_wrong() {
_indexTestUnit('''
main() {
@@ -2314,6 +2265,19 @@ main() {
assertNoAssistAt('|| 2', AssistKind.SPLIT_AND_CONDITION);
}
+ void test_splitAndCondition_wrong_hasElse() {
+ _indexTestUnit('''
+main() {
+ if (1 == 1 && 2 == 2) {
+ print(1);
+ } else {
+ print(2);
+ }
+}
+''');
+ assertNoAssistAt('&& 2', AssistKind.SPLIT_AND_CONDITION);
+ }
+
void test_splitAndCondition_wrong_notPartOfIf() {
_indexTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698