| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library test.services.correction.assist; | 5 library test.services.correction.assist; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart'; | 7 import 'package:analysis_server/src/protocol.dart'; |
| 8 import 'package:analysis_server/src/services/correction/assist.dart'; | 8 import 'package:analysis_server/src/services/correction/assist.dart'; |
| 9 import 'package:analysis_server/src/services/index/index.dart'; | 9 import 'package:analysis_server/src/services/index/index.dart'; |
| 10 import 'package:analysis_server/src/services/index/local_memory_index.dart'; | 10 import 'package:analysis_server/src/services/index/local_memory_index.dart'; |
| (...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1001 } | 1001 } |
| 1002 main(A a) { | 1002 main(A a) { |
| 1003 !a.isEmpty; | 1003 !a.isEmpty; |
| 1004 } | 1004 } |
| 1005 '''); | 1005 '''); |
| 1006 assertNoAssistAt('isEmpty;', AssistKind.CONVERT_INTO_IS_NOT_EMPTY); | 1006 assertNoAssistAt('isEmpty;', AssistKind.CONVERT_INTO_IS_NOT_EMPTY); |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 void test_exchangeBinaryExpressionArguments_OK_compare() { | 1009 void test_exchangeBinaryExpressionArguments_OK_compare() { |
| 1010 Map<String, String> operatorMap = { | 1010 Map<String, String> operatorMap = { |
| 1011 '<': '>=', | 1011 '<': '>', |
| 1012 '<=': '>', | 1012 '<=': '>=', |
| 1013 '>': '<=', | 1013 '>': '<', |
| 1014 '>=': '<' | 1014 '>=': '<=' |
| 1015 }; | 1015 }; |
| 1016 operatorMap.forEach((initialOperator, resultOperator) { | 1016 operatorMap.forEach((initialOperator, resultOperator) { |
| 1017 _indexTestUnit(''' | 1017 _indexTestUnit(''' |
| 1018 bool main(int a, int b) { | 1018 bool main(int a, int b) { |
| 1019 return a $initialOperator b; | 1019 return a $initialOperator b; |
| 1020 } | 1020 } |
| 1021 '''); | 1021 '''); |
| 1022 assertHasAssistAt(initialOperator, AssistKind.EXCHANGE_OPERANDS, ''' | 1022 assertHasAssistAt(initialOperator, AssistKind.EXCHANGE_OPERANDS, ''' |
| 1023 bool main(int a, int b) { | 1023 bool main(int a, int b) { |
| 1024 return b $resultOperator a; | 1024 return b $resultOperator a; |
| (...skipping 1579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2604 void _indexTestUnit(String code) { | 2604 void _indexTestUnit(String code) { |
| 2605 resolveTestUnit(code); | 2605 resolveTestUnit(code); |
| 2606 index.indexUnit(context, testUnit); | 2606 index.indexUnit(context, testUnit); |
| 2607 } | 2607 } |
| 2608 | 2608 |
| 2609 void _setStartEndSelection() { | 2609 void _setStartEndSelection() { |
| 2610 offset = findOffset('// start\n') + '// start\n'.length; | 2610 offset = findOffset('// start\n') + '// start\n'.length; |
| 2611 length = findOffset('// end') - offset; | 2611 length = findOffset('// end') - offset; |
| 2612 } | 2612 } |
| 2613 } | 2613 } |
| OLD | NEW |