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

Unified Diff: pkg/analysis_server/test/edit/refactoring_test.dart

Issue 583193005: Integration of MOVE_FILE into the server and a couple of fixes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months 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
Index: pkg/analysis_server/test/edit/refactoring_test.dart
diff --git a/pkg/analysis_server/test/edit/refactoring_test.dart b/pkg/analysis_server/test/edit/refactoring_test.dart
index b3c407a900a0f89c66377c21c6cf98a39fb2695b..575e07b7377185bc8573b46d37531bca2b8cd0fb 100644
--- a/pkg/analysis_server/test/edit/refactoring_test.dart
+++ b/pkg/analysis_server/test/edit/refactoring_test.dart
@@ -20,9 +20,10 @@ main() {
groupSep = ' | ';
runReflectiveTests(ExtractLocalVariableTest);
runReflectiveTests(ExtractMethodTest);
+ runReflectiveTests(GetAvailableRefactoringsTest);
runReflectiveTests(InlineLocalTest);
runReflectiveTests(InlineMethodTest);
- runReflectiveTests(GetAvailableRefactoringsTest);
+ runReflectiveTests(MoveFileTest);
runReflectiveTests(RenameTest);
}
@@ -708,6 +709,38 @@ main() {
@ReflectiveTestCase()
+class MoveFileTest extends _AbstractGetRefactoring_Test {
+ MoveFileOptions options = new MoveFileOptions(null);
+
+ test_OK() {
+ resourceProvider.newFile('/project/bin/lib.dart', '');
+ addTestFile('''
+import 'dart:math';
+import 'lib.dart';
+''');
+ options.newFile = '/project/test.dart';
+ return assertSuccessfulRefactoring(() {
+ return _sendMoveRequest();
+ }, '''
+import 'dart:math';
+import 'bin/lib.dart';
+''');
+ }
+
+ Future<Response> _sendMoveRequest() {
+ Request request = new EditGetRefactoringParams(
+ RefactoringKind.MOVE_FILE,
+ testFile,
+ 0,
+ 0,
+ false,
+ options: options).toRequest('0');
+ return serverChannel.sendRequest(request);
+ }
+}
+
+
+@ReflectiveTestCase()
class RenameTest extends _AbstractGetRefactoring_Test {
Future<Response> sendRenameRequest(String search, String newName,
[bool validateOnly = false]) {

Powered by Google App Engine
This is Rietveld 408576698