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

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

Issue 1011613002: Issue 22845. Rename should prevent the use of invalid identifiers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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/lib/src/services/refactoring/naming_conventions.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.naming_conventions; 5 library test.services.refactoring.naming_conventions;
6 6
7 import 'package:analysis_server/src/protocol.dart' 7 import 'package:analysis_server/src/protocol.dart'
8 show RefactoringProblemSeverity; 8 show RefactoringProblemSeverity;
9 import 'package:analysis_server/src/services/refactoring/naming_conventions.dart '; 9 import 'package:analysis_server/src/services/refactoring/naming_conventions.dart ';
10 import 'package:analysis_server/src/services/refactoring/refactoring.dart'; 10 import 'package:analysis_server/src/services/refactoring/refactoring.dart';
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 validateMethodName("NewName"), RefactoringProblemSeverity.WARNING, 472 validateMethodName("NewName"), RefactoringProblemSeverity.WARNING,
473 expectedMessage: "Method name should start with a lowercase letter."); 473 expectedMessage: "Method name should start with a lowercase letter.");
474 } 474 }
475 475
476 void test_validateMethodName_empty() { 476 void test_validateMethodName_empty() {
477 assertRefactoringStatus( 477 assertRefactoringStatus(
478 validateMethodName(""), RefactoringProblemSeverity.FATAL, 478 validateMethodName(""), RefactoringProblemSeverity.FATAL,
479 expectedMessage: "Method name must not be empty."); 479 expectedMessage: "Method name must not be empty.");
480 } 480 }
481 481
482 void test_validateMethodName_keyword() {
483 assertRefactoringStatus(
484 validateMethodName("for"), RefactoringProblemSeverity.FATAL,
485 expectedMessage: "Method name must not be a keyword.");
486 }
487
482 void test_validateMethodName_leadingBlanks() { 488 void test_validateMethodName_leadingBlanks() {
483 assertRefactoringStatus( 489 assertRefactoringStatus(
484 validateMethodName(" newName"), RefactoringProblemSeverity.FATAL, 490 validateMethodName(" newName"), RefactoringProblemSeverity.FATAL,
485 expectedMessage: "Method name must not start or end with a blank."); 491 expectedMessage: "Method name must not start or end with a blank.");
486 } 492 }
487 493
488 void test_validateMethodName_notIdentifierMiddle() { 494 void test_validateMethodName_notIdentifierMiddle() {
489 assertRefactoringStatus( 495 assertRefactoringStatus(
490 validateMethodName("new-Name"), RefactoringProblemSeverity.FATAL, 496 validateMethodName("new-Name"), RefactoringProblemSeverity.FATAL,
491 expectedMessage: "Method name must not contain '-'."); 497 expectedMessage: "Method name must not contain '-'.");
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 void test_validateVariableName_OK_middleUnderscore() { 632 void test_validateVariableName_OK_middleUnderscore() {
627 assertRefactoringStatusOK(validateVariableName("new_name")); 633 assertRefactoringStatusOK(validateVariableName("new_name"));
628 } 634 }
629 635
630 void test_validateVariableName_trailingBlanks() { 636 void test_validateVariableName_trailingBlanks() {
631 assertRefactoringStatus( 637 assertRefactoringStatus(
632 validateVariableName("newName "), RefactoringProblemSeverity.FATAL, 638 validateVariableName("newName "), RefactoringProblemSeverity.FATAL,
633 expectedMessage: "Variable name must not start or end with a blank."); 639 expectedMessage: "Variable name must not start or end with a blank.");
634 } 640 }
635 } 641 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/refactoring/naming_conventions.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698