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

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

Issue 545943003: Include additional information into RenameFeedback. (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 unified diff | Download patch | Annotate | Revision Log
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_class_member; 5 library test.services.refactoring.rename_class_member;
6 6
7 import 'package:analysis_server/src/protocol.dart'; 7 import 'package:analysis_server/src/protocol.dart';
8 import '../../reflective_tests.dart'; 8 import '../../reflective_tests.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 a.test += 2; 349 a.test += 2;
350 print(b.test); 350 print(b.test);
351 b.test = 1; 351 b.test = 1;
352 print(c.test); 352 print(c.test);
353 c.test = 1; 353 c.test = 1;
354 } 354 }
355 '''); 355 ''');
356 // configure refactoring 356 // configure refactoring
357 createRenameRefactoringAtString('test; // marker'); 357 createRenameRefactoringAtString('test; // marker');
358 expect(refactoring.refactoringName, 'Rename Field'); 358 expect(refactoring.refactoringName, 'Rename Field');
359 expect(refactoring.elementKindName, 'field');
359 expect(refactoring.oldName, 'test'); 360 expect(refactoring.oldName, 'test');
360 refactoring.newName = 'newName'; 361 refactoring.newName = 'newName';
361 // validate change 362 // validate change
362 return assertSuccessfulRefactoring(''' 363 return assertSuccessfulRefactoring('''
363 class A { 364 class A {
364 int newName; // marker 365 int newName; // marker
365 main() { 366 main() {
366 print(newName); 367 print(newName);
367 newName = 1; 368 newName = 1;
368 newName += 2; 369 newName += 2;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 a.test(); 493 a.test();
493 b.test(); 494 b.test();
494 c.test(); 495 c.test();
495 d.test(); 496 d.test();
496 e.test(); 497 e.test();
497 } 498 }
498 '''); 499 ''');
499 // configure refactoring 500 // configure refactoring
500 createRenameRefactoringAtString('test() {} // marker'); 501 createRenameRefactoringAtString('test() {} // marker');
501 expect(refactoring.refactoringName, 'Rename Method'); 502 expect(refactoring.refactoringName, 'Rename Method');
503 expect(refactoring.elementKindName, 'method');
502 expect(refactoring.oldName, 'test'); 504 expect(refactoring.oldName, 'test');
503 refactoring.newName = 'newName'; 505 refactoring.newName = 'newName';
504 // validate change 506 // validate change
505 return assertSuccessfulRefactoring(''' 507 return assertSuccessfulRefactoring('''
506 class A { 508 class A {
507 newName() {} 509 newName() {}
508 } 510 }
509 class B extends A { 511 class B extends A {
510 newName() {} // marker 512 newName() {} // marker
511 } 513 }
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 indexTestUnit(''' 715 indexTestUnit('''
714 class A<Test> { 716 class A<Test> {
715 Test field; 717 Test field;
716 List<Test> items; 718 List<Test> items;
717 Test method(Test p) => null; 719 Test method(Test p) => null;
718 } 720 }
719 '''); 721 ''');
720 // configure refactoring 722 // configure refactoring
721 createRenameRefactoringAtString('Test> {'); 723 createRenameRefactoringAtString('Test> {');
722 expect(refactoring.refactoringName, 'Rename Type Parameter'); 724 expect(refactoring.refactoringName, 'Rename Type Parameter');
725 expect(refactoring.elementKindName, 'type parameter');
723 expect(refactoring.oldName, 'Test'); 726 expect(refactoring.oldName, 'Test');
724 refactoring.newName = 'NewName'; 727 refactoring.newName = 'NewName';
725 // validate change 728 // validate change
726 return assertSuccessfulRefactoring(''' 729 return assertSuccessfulRefactoring('''
727 class A<NewName> { 730 class A<NewName> {
728 NewName field; 731 NewName field;
729 List<NewName> items; 732 List<NewName> items;
730 NewName method(NewName p) => null; 733 NewName method(NewName p) => null;
731 } 734 }
732 '''); 735 ''');
733 } 736 }
734 } 737 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698