| 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_local; | 5 library test.services.refactoring.inline_local; |
| 6 | 6 |
| 7 import 'package:analysis_server/src/protocol.dart' hide Element; | 7 import 'package:analysis_server/src/protocol.dart' hide Element; |
| 8 import 'package:analysis_server/src/services/correction/status.dart'; | 8 import 'package:analysis_server/src/services/correction/status.dart'; |
| 9 import 'package:analysis_server/src/services/refactoring/inline_local.dart'; | 9 import 'package:analysis_server/src/services/refactoring/inline_local.dart'; |
| 10 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; | 10 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; |
| 11 import 'package:unittest/unittest.dart'; | 11 import 'package:unittest/unittest.dart'; |
| 12 | 12 |
| 13 import '../../reflective_tests.dart'; | 13 import '../../reflective_tests.dart'; |
| 14 import 'abstract_refactoring.dart'; | 14 import 'abstract_refactoring.dart'; |
| 15 | 15 |
| 16 | 16 |
| 17 main() { | 17 main() { |
| 18 groupSep = ' | '; | 18 groupSep = ' | '; |
| 19 runReflectiveTests(InlineLocalTest); | 19 runReflectiveTests(InlineLocalTest); |
| 20 } | 20 } |
| 21 | 21 |
| 22 | 22 |
| 23 @ReflectiveTestCase() | 23 @reflectiveTest |
| 24 class InlineLocalTest extends RefactoringTest { | 24 class InlineLocalTest extends RefactoringTest { |
| 25 InlineLocalRefactoringImpl refactoring; | 25 InlineLocalRefactoringImpl refactoring; |
| 26 | 26 |
| 27 test_access() { | 27 test_access() { |
| 28 indexTestUnit(''' | 28 indexTestUnit(''' |
| 29 main() { | 29 main() { |
| 30 int test = 1 + 2; | 30 int test = 1 + 2; |
| 31 print(test); | 31 print(test); |
| 32 print(test); | 32 print(test); |
| 33 } | 33 } |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 584 RefactoringProblemSeverity.FATAL, | 584 RefactoringProblemSeverity.FATAL, |
| 585 expectedMessage: 'Local variable declaration or reference must be ' | 585 expectedMessage: 'Local variable declaration or reference must be ' |
| 586 'selected to activate this refactoring.'); | 586 'selected to activate this refactoring.'); |
| 587 } | 587 } |
| 588 | 588 |
| 589 void _createRefactoring(String search) { | 589 void _createRefactoring(String search) { |
| 590 int offset = findOffset(search); | 590 int offset = findOffset(search); |
| 591 refactoring = new InlineLocalRefactoring(searchEngine, testUnit, offset); | 591 refactoring = new InlineLocalRefactoring(searchEngine, testUnit, offset); |
| 592 } | 592 } |
| 593 } | 593 } |
| OLD | NEW |