| 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.refactoring.inline_method; | 5 library test.services.refactoring.inline_method; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/protocol.dart' hide Element; | 9 import 'package:analysis_server/src/protocol.dart' hide Element; |
| 10 import 'package:analysis_server/src/services/refactoring/inline_method.dart'; | 10 import 'package:analysis_server/src/services/refactoring/inline_method.dart'; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 indexTestUnit(r''' | 154 indexTestUnit(r''' |
| 155 class A { | 155 class A { |
| 156 operator -(other) => this; | 156 operator -(other) => this; |
| 157 } | 157 } |
| 158 '''); | 158 '''); |
| 159 _createRefactoring('-(other)'); | 159 _createRefactoring('-(other)'); |
| 160 // error | 160 // error |
| 161 return _assertConditionsFatal('Cannot inline operator.'); | 161 return _assertConditionsFatal('Cannot inline operator.'); |
| 162 } | 162 } |
| 163 | 163 |
| 164 test_bad_propertyAccessor_synthetic() { |
| 165 indexTestUnit(r''' |
| 166 class A { |
| 167 int fff; |
| 168 } |
| 169 |
| 170 main(A a) { |
| 171 print(a.fff); |
| 172 } |
| 173 '''); |
| 174 _createRefactoring('fff);'); |
| 175 // error |
| 176 return _assertInvalidSelection(); |
| 177 } |
| 178 |
| 164 test_bad_reference_toClassMethod() { | 179 test_bad_reference_toClassMethod() { |
| 165 indexTestUnit(r''' | 180 indexTestUnit(r''' |
| 166 class A { | 181 class A { |
| 167 test(a, b) { | 182 test(a, b) { |
| 168 print(a); | 183 print(a); |
| 169 print(b); | 184 print(b); |
| 170 } | 185 } |
| 171 } | 186 } |
| 172 main() { | 187 main() { |
| 173 print(new A().test); | 188 print(new A().test); |
| (...skipping 1244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 }); | 1433 }); |
| 1419 }); | 1434 }); |
| 1420 }); | 1435 }); |
| 1421 } | 1436 } |
| 1422 | 1437 |
| 1423 void _createRefactoring(String search) { | 1438 void _createRefactoring(String search) { |
| 1424 int offset = findOffset(search); | 1439 int offset = findOffset(search); |
| 1425 refactoring = new InlineMethodRefactoring(searchEngine, testUnit, offset); | 1440 refactoring = new InlineMethodRefactoring(searchEngine, testUnit, offset); |
| 1426 } | 1441 } |
| 1427 } | 1442 } |
| OLD | NEW |