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

Side by Side Diff: pkg/analysis_server/test/edit/refactoring_test.dart

Issue 1364853007: Issue 24440. Fix for renaming libraries using 'part of' directives. (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 | « no previous file | pkg/analyzer/lib/src/generated/ast.dart » ('j') | 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.edit.refactoring; 5 library test.edit.refactoring;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/edit/edit_domain.dart'; 9 import 'package:analysis_server/src/edit/edit_domain.dart';
10 import 'package:analysis_server/src/protocol.dart'; 10 import 'package:analysis_server/src/protocol.dart';
(...skipping 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1641 library aaa.bbb.ccc; 1641 library aaa.bbb.ccc;
1642 '''); 1642 ''');
1643 return assertSuccessfulRefactoring(() { 1643 return assertSuccessfulRefactoring(() {
1644 return sendRenameRequest('.bbb', 'my.new_name'); 1644 return sendRenameRequest('.bbb', 'my.new_name');
1645 }, 1645 },
1646 ''' 1646 '''
1647 library my.new_name; 1647 library my.new_name;
1648 '''); 1648 ''');
1649 } 1649 }
1650 1650
1651 test_library_partOfDirective() {
1652 addFile(
1653 '$testFolder/my_lib.dart',
1654 '''
1655 library aaa.bbb.ccc;
1656 part 'test.dart';
1657 ''');
1658 addTestFile('''
1659 part of aaa.bbb.ccc;
1660 ''');
1661 return assertSuccessfulRefactoring(() {
1662 return sendRenameRequest('aaa.bb', 'my.new_name');
1663 },
1664 '''
1665 part of my.new_name;
1666 ''');
1667 }
1668
1651 test_localVariable() { 1669 test_localVariable() {
1652 addTestFile(''' 1670 addTestFile('''
1653 main() { 1671 main() {
1654 int test = 0; 1672 int test = 0;
1655 test = 1; 1673 test = 1;
1656 test += 2; 1674 test += 2;
1657 print(test); 1675 print(test);
1658 } 1676 }
1659 '''); 1677 ''');
1660 return assertSuccessfulRefactoring(() { 1678 return assertSuccessfulRefactoring(() {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 .toRequest('0'); 1896 .toRequest('0');
1879 return _assertErrorResposeNoIndex(request); 1897 return _assertErrorResposeNoIndex(request);
1880 } 1898 }
1881 1899
1882 _assertErrorResposeNoIndex(Request request) async { 1900 _assertErrorResposeNoIndex(Request request) async {
1883 Response response = await serverChannel.sendRequest(request); 1901 Response response = await serverChannel.sendRequest(request);
1884 expect(response.error, isNotNull); 1902 expect(response.error, isNotNull);
1885 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED); 1903 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED);
1886 } 1904 }
1887 } 1905 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/ast.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698