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

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

Issue 576703004: Send final problems even if 'validateOnly'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Request expensive validation in 'checkFinalConditions'. 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
« no previous file with comments | « pkg/analysis_server/test/edit/refactoring_test.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_local; 5 library test.services.refactoring.rename_local;
6 6
7 import 'package:analysis_server/src/protocol.dart'; 7 import 'package:analysis_server/src/protocol.dart';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import '../../reflective_tests.dart'; 10 import '../../reflective_tests.dart';
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 RefactoringProblemSeverity.ERROR, 54 RefactoringProblemSeverity.ERROR,
55 expectedMessage: "Duplicate function 'newName'."); 55 expectedMessage: "Duplicate function 'newName'.");
56 }); 56 });
57 } 57 }
58 58
59 test_checkFinalConditions_hasLocalVariable_after() { 59 test_checkFinalConditions_hasLocalVariable_after() {
60 indexTestUnit(''' 60 indexTestUnit('''
61 main() { 61 main() {
62 int test = 0; 62 int test = 0;
63 var newName = 1; 63 var newName = 1;
64 print(newName);
64 } 65 }
65 '''); 66 ''');
66 createRenameRefactoringAtString('test = 0'); 67 createRenameRefactoringAtString('test = 0');
67 // check status 68 // check status
68 refactoring.newName = 'newName'; 69 refactoring.newName = 'newName';
69 return refactoring.checkFinalConditions().then((status) { 70 return refactoring.checkFinalConditions().then((status) {
71 expect(status.problems, hasLength(1));
70 assertRefactoringStatus( 72 assertRefactoringStatus(
71 status, 73 status,
72 RefactoringProblemSeverity.ERROR, 74 RefactoringProblemSeverity.ERROR,
73 expectedMessage: "Duplicate local variable 'newName'.", 75 expectedMessage: "Duplicate local variable 'newName'.",
74 expectedContextSearch: 'newName = 1;'); 76 expectedContextSearch: 'newName = 1;');
75 }); 77 });
76 } 78 }
77 79
78 test_checkFinalConditions_hasLocalVariable_before() { 80 test_checkFinalConditions_hasLocalVariable_before() {
79 indexTestUnit(''' 81 indexTestUnit('''
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 main() { 482 main() {
481 int test = 0; 483 int test = 0;
482 } 484 }
483 '''); 485 ''');
484 // configure refactoring 486 // configure refactoring
485 createRenameRefactoringAtString('test = 0'); 487 createRenameRefactoringAtString('test = 0');
486 // old name 488 // old name
487 expect(refactoring.oldName, 'test'); 489 expect(refactoring.oldName, 'test');
488 } 490 }
489 } 491 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/edit/refactoring_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698