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

Unified Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 586453003: Issue 13783. Add file from missing import. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix_internal.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/correction/fix_test.dart
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index 32d05090ef83d1edb5f77224f5b2a7fc3ced5638..c434434edd54e1c68bd393e7244c5139aff5c67e 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -395,6 +395,23 @@ main() {
''');
}
+ void test_createFile_forImport() {
+ testFile = '/my/project/bin/test.dart';
+ _indexTestUnit('''
+import 'my_file.dart';
+''');
+ AnalysisError error = _findErrorToFix();
+ fix = _assertHasFix(FixKind.CREATE_FILE, error);
+ change = fix.change;
+ // validate change
+ List<SourceFileEdit> fileEdits = change.edits;
+ expect(fileEdits, hasLength(1));
+ SourceFileEdit fileEdit = change.edits[0];
+ expect(fileEdit.file, '/my/project/bin/my_file.dart');
+ expect(fileEdit.fileStamp, -1);
+ expect(fileEdit.edits[0].replacement, contains('library my.file;'));
+ }
+
void test_createMissingOverrides_functionType() {
_indexTestUnit('''
abstract class A {
« 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