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

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

Issue 1013543002: Quick Fix for creating a missing part file. (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 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 9fa1a7c2624164f9eac24cb9b484c5e39f2079fe..d5c9b7804154864f60b70482dab97a87af053c52 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -859,6 +859,24 @@ import 'my_file.dart';
expect(fileEdit.edits[0].replacement, contains('library my.file;'));
}
+ void test_createFile_forPart() {
+ testFile = '/my/project/bin/test.dart';
+ resolveTestUnit('''
+library my.lib;
+part 'my_part.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_part.dart');
+ expect(fileEdit.fileStamp, -1);
+ expect(fileEdit.edits[0].replacement, contains('part of my.lib;'));
+ }
+
void test_createGetter_BAD_inSDK() {
resolveTestUnit('''
main(List p) {
« 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