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

Side by Side Diff: pkg/analysis_server/test/services/correction/assist_test.dart

Issue 800593002: Fix for exchaning comparison operators arguments. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/assist_internal.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« 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