| Index: pkg/analysis_server/test/edit/fixes_test.dart
|
| diff --git a/pkg/analysis_server/test/edit/fixes_test.dart b/pkg/analysis_server/test/edit/fixes_test.dart
|
| index a27dd4a989c0844a31678f6e770d59748d0d123d..51700383d0ad2e47af43f104baf2c580efbfa5ba 100644
|
| --- a/pkg/analysis_server/test/edit/fixes_test.dart
|
| +++ b/pkg/analysis_server/test/edit/fixes_test.dart
|
| @@ -6,16 +6,12 @@ library test.edit.fixes;
|
|
|
| import 'dart:async';
|
|
|
| -import 'package:analysis_server/src/computer/element.dart';
|
| -import 'package:analysis_server/src/computer/error.dart';
|
| import 'package:analysis_server/src/constants.dart';
|
| import 'package:analysis_server/src/edit/edit_domain.dart';
|
| -import 'package:analysis_server/src/edit/fix.dart';
|
| import 'package:analysis_server/src/protocol.dart';
|
| import 'package:analysis_services/constants.dart';
|
| -import 'package:analysis_services/correction/change.dart';
|
| import 'package:analysis_testing/reflective_tests.dart';
|
| -import 'package:unittest/unittest.dart';
|
| +import 'package:unittest/unittest.dart' hide ERROR;
|
|
|
| import '../analysis_abstract.dart';
|
|
|
| @@ -47,37 +43,13 @@ main() {
|
| request.setParameter(OFFSET, findOffset('print'));
|
| Response response = handleSuccessfulRequest(request);
|
| List<Map<String, Object>> errorFixesJsonList = response.getResult(FIXES);
|
| - List<ErrorFixes> errorFixesList = errorFixesJsonList.map(ErrorFixes.fromJson).toList();
|
| - expect(errorFixesList, hasLength(1));
|
| + expect(errorFixesJsonList, hasLength(1));
|
| {
|
| - ErrorFixes errorFixes = errorFixesList[0];
|
| - {
|
| - AnalysisError error = errorFixes.error;
|
| - expect(error.severity, 'ERROR');
|
| - expect(error.type, 'SYNTACTIC_ERROR');
|
| - expect(error.message, "Expected to find ';'");
|
| - {
|
| - Location location = error.location;
|
| - expect(location.file, testFile);
|
| - expect(location.offset, 19);
|
| - expect(location.length, 1);
|
| - expect(location.startLine, 2);
|
| - expect(location.startColumn, 11);
|
| - }
|
| - }
|
| - expect(errorFixes.fixes, hasLength(1));
|
| - {
|
| - Change change = errorFixes.fixes[0];
|
| - expect(change.message, "Insert ';'");
|
| - expect(change.edits, hasLength(1));
|
| - {
|
| - FileEdit fileEdit = change.edits[0];
|
| - expect(fileEdit.file, testFile);
|
| - expect(
|
| - fileEdit.edits.toString(),
|
| - "[Edit(offset=20, length=0, replacement=:>;<:)]");
|
| - }
|
| - }
|
| + Map<String, Object> fixes = errorFixesJsonList[0];
|
| + Map<String, Object> error = fixes[ERROR];
|
| + expect(error[SEVERITY], 'ERROR');
|
| + expect(error[TYPE], 'SYNTACTIC_ERROR');
|
| + expect(fixes[FIXES], hasLength(1));
|
| }
|
| });
|
| }
|
|
|