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

Side by Side Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 1013303002: Fix for NPE in the field creation Quick Fix. (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/correction/fix_internal.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.correction.fix; 5 library test.services.correction.fix;
6 6
7 import 'package:analysis_server/src/protocol.dart' hide AnalysisError; 7 import 'package:analysis_server/src/protocol.dart' hide AnalysisError;
8 import 'package:analysis_server/src/services/correction/fix.dart'; 8 import 'package:analysis_server/src/services/correction/fix.dart';
9 import 'package:analyzer/file_system/file_system.dart'; 9 import 'package:analyzer/file_system/file_system.dart';
10 import 'package:analyzer/source/package_map_resolver.dart'; 10 import 'package:analyzer/source/package_map_resolver.dart';
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 resolveTestUnit(''' 593 resolveTestUnit('''
594 class A { 594 class A {
595 A._named(p); 595 A._named(p);
596 } 596 }
597 class B extends A { 597 class B extends A {
598 } 598 }
599 '''); 599 ''');
600 assertNoFix(FixKind.CREATE_CONSTRUCTOR_SUPER); 600 assertNoFix(FixKind.CREATE_CONSTRUCTOR_SUPER);
601 } 601 }
602 602
603 void test_createField_BAD_inEnum() {
604 resolveTestUnit('''
605 enum MyEnum {
606 AAA, BBB
607 }
608 main() {
609 MyEnum.foo;
610 }
611 ''');
612 assertNoFix(FixKind.CREATE_FIELD);
613 }
614
603 void test_createField_BAD_inSDK() { 615 void test_createField_BAD_inSDK() {
604 resolveTestUnit(''' 616 resolveTestUnit('''
605 main(List p) { 617 main(List p) {
606 p.foo = 1; 618 p.foo = 1;
607 } 619 }
608 '''); 620 ''');
609 assertNoFix(FixKind.CREATE_FIELD); 621 assertNoFix(FixKind.CREATE_FIELD);
610 } 622 }
611 623
612 void test_createField_getter_multiLevel() { 624 void test_createField_getter_multiLevel() {
(...skipping 2708 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 3333
3322 List<Position> _findResultPositions(List<String> searchStrings) { 3334 List<Position> _findResultPositions(List<String> searchStrings) {
3323 List<Position> positions = <Position>[]; 3335 List<Position> positions = <Position>[];
3324 for (String search in searchStrings) { 3336 for (String search in searchStrings) {
3325 int offset = resultCode.indexOf(search); 3337 int offset = resultCode.indexOf(search);
3326 positions.add(new Position(testFile, offset)); 3338 positions.add(new Position(testFile, offset));
3327 } 3339 }
3328 return positions; 3340 return positions;
3329 } 3341 }
3330 } 3342 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698