Reduce the test scope of get_fixes_test.dart.

BUG=
R=brianwilkerson@google.com

Review-Url: https://codereview.chromium.org/2932343002 .
This commit is contained in:
Devon Carew
2017-06-12 08:24:51 -07:00
parent 32071cffc3
commit 10a5bfaa08
@@ -2,8 +2,6 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
import 'package:analysis_server/protocol/protocol_generated.dart';
import 'package:analyzer_plugin/protocol/protocol_common.dart';
import 'package:test/test.dart';
@@ -39,20 +37,10 @@ Future f;
expect(fix.error.code, 'undefined_class');
expect(fix.fixes, isNotEmpty);
// apply the fix, expect that the new code has no errors
SourceChange change = fix.fixes.singleWhere(
(SourceChange change) => change.message.startsWith('Import '));
expect(change.edits, hasLength(1));
expect(change.edits.first.edits, hasLength(1));
SourceEdit edit = change.edits.first.edits.first;
text = text.replaceRange(edit.offset, edit.end, edit.replacement);
// save the fixed text as an overlay
Future analysisFinishedFuture = analysisFinished;
sendAnalysisUpdateContent({pathname: new AddContentOverlay(text)});
await analysisFinishedFuture;
expect(currentAnalysisErrors[pathname], isEmpty);
}
test_no_fixes() async {