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

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

Issue 793373004: Don't send a refactoring feedback in case of a fatal initial problem. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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/lib/src/services/correction/statement_analyzer.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.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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 int b = 2; 430 int b = 2;
431 print(res(b, a)); 431 print(res(b, a));
432 print(res(b, a)); 432 print(res(b, a));
433 } 433 }
434 434
435 int res(num bbb, int aaa) => aaa + bbb; 435 int res(num bbb, int aaa) => aaa + bbb;
436 '''); 436 ''');
437 }); 437 });
438 } 438 }
439 439
440 test_init_fatalError_invalidStatement() {
441 addTestFile('''
442 main(bool b) {
443 // start
444 if (b) {
445 print(1);
446 // end
447 print(2);
448 }
449 }
450 ''');
451 _setOffsetLengthForStartEnd();
452 return waitForTasksFinished().then((_) {
453 return _sendExtractRequest();
454 }).then((Response response) {
455 var result = new EditGetRefactoringResult.fromResponse(response);
456 assertResultProblemsFatal(result.initialProblems);
457 // ...there is no any feedback
458 expect(result.feedback, isNull);
459 });
460 }
461
440 test_names() { 462 test_names() {
441 addTestFile(''' 463 addTestFile('''
442 class TreeItem {} 464 class TreeItem {}
443 TreeItem getSelectedItem() => null; 465 TreeItem getSelectedItem() => null;
444 main() { 466 main() {
445 var a = getSelectedItem( ); 467 var a = getSelectedItem( );
446 } 468 }
447 '''); 469 ''');
448 _setOffsetLengthForString('getSelectedItem( )'); 470 _setOffsetLengthForString('getSelectedItem( )');
449 return _computeInitialFeedback().then((feedback) { 471 return _computeInitialFeedback().then((feedback) {
(...skipping 1167 matching lines...) Expand 10 before | Expand all | Expand 10 after
1617 } 1639 }
1618 1640
1619 @override 1641 @override
1620 void setUp() { 1642 void setUp() {
1621 super.setUp(); 1643 super.setUp();
1622 server.handlers = [new EditDomainHandler(server),]; 1644 server.handlers = [new EditDomainHandler(server),];
1623 createProject(); 1645 createProject();
1624 handler = new EditDomainHandler(server); 1646 handler = new EditDomainHandler(server);
1625 } 1647 }
1626 } 1648 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/statement_analyzer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698