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

Unified Diff: pkg/analysis_server/test/analysis_server_test.dart

Issue 311653002: Extract analysis/notifications into a separate operation/file. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Tweak for the test method name. Created 6 years, 7 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
Index: pkg/analysis_server/test/analysis_server_test.dart
diff --git a/pkg/analysis_server/test/analysis_server_test.dart b/pkg/analysis_server/test/analysis_server_test.dart
index 8181fe97af904efc3b358797d51d99186d032301..3389f1d35b10ec0a719e3eee601af9183db08762 100644
--- a/pkg/analysis_server/test/analysis_server_test.dart
+++ b/pkg/analysis_server/test/analysis_server_test.dart
@@ -68,49 +68,6 @@ main() {
});
});
- test('errorToJson_formattingApplied', () {
- MockSource source = new MockSource();
- source.when(callsTo('get encoding')).alwaysReturn('foo.dart');
- CompileTimeErrorCode errorCode = CompileTimeErrorCode.AMBIGUOUS_EXPORT;
- AnalysisError analysisError =
- new AnalysisError.con1(source, errorCode, ['foo', 'bar', 'baz']);
- Map<String, Object> json = AnalysisServer.errorToJson(analysisError);
-
- expect(json['message'],
- equals("The name 'foo' is defined in the libraries 'bar' and 'baz'"));
- });
-
- test('errorToJson_noCorrection', () {
- MockSource source = new MockSource();
- source.when(callsTo('get fullName')).alwaysReturn('foo.dart');
- CompileTimeErrorCode errorCode =
- CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER;
- AnalysisError analysisError =
- new AnalysisError.con2(source, 10, 5, errorCode, ['Foo']);
- Map<String, Object> json = AnalysisServer.errorToJson(analysisError);
- expect(json, hasLength(5));
- expect(json['file'], equals('foo.dart'));
- expect(json['errorCode'], 'CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_NON_CONST_SUPER');
- expect(json['offset'], equals(analysisError.offset));
- expect(json['length'], equals(analysisError.length));
- expect(json['message'], equals(errorCode.message.replaceAll('%s', 'Foo')));
- });
-
- test('errorToJson_withCorrection', () {
- MockSource source = new MockSource();
- source.when(callsTo('get encoding')).alwaysReturn('foo.dart');
-
- // TODO(paulberry): in principle we should test an error or hint that uses
- // %s formatting in its correction string. But no such errors or hints
- // currently exist!
- HintCode errorCode = HintCode.MISSING_RETURN;
-
- AnalysisError analysisError =
- new AnalysisError.con2(source, 10, 5, errorCode, ['int']);
- Map<String, Object> json = AnalysisServer.errorToJson(analysisError);
- expect(json['correction'], equals(errorCode.correction));
- });
-
test('shutdown', () {
AnalysisServerTestHelper helper = new AnalysisServerTestHelper();
helper.server.handlers = [new ServerDomainHandler(helper.server)];

Powered by Google App Engine
This is Rietveld 408576698