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

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

Issue 756483002: Exchanging operands of a comparision operator should invert the operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/test/mock_sdk.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 31fcc4f352fb7e8f6fb5185b7e52e2a165cebe83..e5916c714e7226b6e4733633b124947696bf4b1b 100644
--- a/pkg/analysis_server/test/services/correction/assist_test.dart
+++ b/pkg/analysis_server/test/services/correction/assist_test.dart
@@ -1006,6 +1006,27 @@ main(A a) {
assertNoAssistAt('isEmpty;', AssistKind.CONVERT_INTO_IS_NOT_EMPTY);
}
+ void test_exchangeBinaryExpressionArguments_OK_compare() {
+ Map<String, String> operatorMap = {
+ '<': '>=',
+ '<=': '>',
+ '>': '<=',
+ '>=': '<'
+ };
+ operatorMap.forEach((initialOperator, resultOperator) {
+ _indexTestUnit('''
+bool main(int a, int b) {
+ return a $initialOperator b;
+}
+''');
+ assertHasAssistAt(initialOperator, AssistKind.EXCHANGE_OPERANDS, '''
+bool main(int a, int b) {
+ return b $resultOperator a;
+}
+''');
+ });
+ }
+
void test_exchangeBinaryExpressionArguments_OK_extended_mixOperator_1() {
_indexTestUnit('''
main() {
« no previous file with comments | « pkg/analysis_server/test/mock_sdk.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698