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

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

Issue 585073002: Issue 18296. Harden the name checks. (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.extract_method; 5 library test.services.refactoring.extract_method;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'package:analysis_server/src/services/refactoring/extract_method.dart'; 10 import 'package:analysis_server/src/services/refactoring/extract_method.dart';
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 indexTestUnit(''' 336 indexTestUnit('''
337 main() { 337 main() {
338 // start 338 // start
339 print(0); 339 print(0);
340 // end 340 // end
341 } 341 }
342 '''); 342 ''');
343 _createRefactoringForStartEndComments(); 343 _createRefactoringForStartEndComments();
344 refactoring.name = 'bad-name'; 344 refactoring.name = 'bad-name';
345 // check conditions 345 // check conditions
346 return _assertConditionsError("Method name must not contain '-'."); 346 return _assertConditionsFatal("Method name must not contain '-'.");
347 } 347 }
348 348
349 test_bad_notSameParent() { 349 test_bad_notSameParent() {
350 indexTestUnit(''' 350 indexTestUnit('''
351 main() { 351 main() {
352 while (false) 352 while (false)
353 // start 353 // start
354 { 354 {
355 } 355 }
356 print(0); 356 print(0);
(...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after
2308 * Returns a deep copy of [refactoring] parameters. 2308 * Returns a deep copy of [refactoring] parameters.
2309 * There was a bug masked by updating parameter instances shared between the 2309 * There was a bug masked by updating parameter instances shared between the
2310 * refactoring and the test. 2310 * refactoring and the test.
2311 */ 2311 */
2312 List<RefactoringMethodParameter> _getParametersCopy() { 2312 List<RefactoringMethodParameter> _getParametersCopy() {
2313 return refactoring.parameters.map((p) { 2313 return refactoring.parameters.map((p) {
2314 return new RefactoringMethodParameter(p.kind, p.type, p.name, id: p.id); 2314 return new RefactoringMethodParameter(p.kind, p.type, p.name, id: p.id);
2315 }).toList(); 2315 }).toList();
2316 } 2316 }
2317 } 2317 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698