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

Side by Side Diff: pkg/analysis_server/test/services/refactoring/rename_library_test.dart

Issue 1370793003: Issue 24442. Fix for renaming library names with spaces. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/source_range.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.refactoring.rename_library; 5 library test.services.refactoring.rename_library;
6 6
7 import 'package:analysis_server/src/protocol.dart'; 7 import 'package:analysis_server/src/protocol.dart';
8 import 'package:analyzer/src/generated/source.dart'; 8 import 'package:analyzer/src/generated/source.dart';
9 import 'package:test_reflective_loader/test_reflective_loader.dart'; 9 import 'package:test_reflective_loader/test_reflective_loader.dart';
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 library the.new.name; 64 library the.new.name;
65 part 'part.dart'; 65 part 'part.dart';
66 '''); 66 ''');
67 assertFileChangeResult( 67 assertFileChangeResult(
68 '/part.dart', 68 '/part.dart',
69 ''' 69 '''
70 part of the.new.name; 70 part of the.new.name;
71 '''); 71 ''');
72 } 72 }
73 73
74 test_createChange_hasWhitespaces() async {
75 Source unitSource = addSource(
76 '/part.dart',
77 '''
78 part of my . app;
79 ''');
80 indexTestUnit('''
81 library my . app;
82 part 'part.dart';
83 ''');
84 index.index(
85 context, context.resolveCompilationUnit2(unitSource, testSource));
86 // configure refactoring
87 _createRenameRefactoring();
88 expect(refactoring.refactoringName, 'Rename Library');
89 expect(refactoring.elementKindName, 'library');
90 refactoring.newName = 'the.new.name';
91 // validate change
92 await assertSuccessfulRefactoring('''
93 library the.new.name;
94 part 'part.dart';
95 ''');
96 assertFileChangeResult(
97 '/part.dart',
98 '''
99 part of the.new.name;
100 ''');
101 }
102
74 void _createRenameRefactoring() { 103 void _createRenameRefactoring() {
75 createRenameRefactoringForElement(testUnitElement.library); 104 createRenameRefactoringForElement(testUnitElement.library);
76 } 105 }
77 } 106 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/source_range.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698