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

Unified Diff: pkg/analysis_server/test/edit/fixes_test.dart

Issue 447613002: Make Change implementation consistent with the server spec. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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/test/edit/fix_test.dart ('k') | pkg/analysis_services/lib/constants.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
});
}
« no previous file with comments | « pkg/analysis_server/test/edit/fix_test.dart ('k') | pkg/analysis_services/lib/constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698