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

Unified Diff: pkg/analysis_server/test/integration/analysis/get_hover_test.dart

Issue 628783002: Change integration test send...() methods to return structured objects. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/integration/analysis/get_hover_test.dart
diff --git a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
index b8fca7580933ea12e39d978531060c10bc95d826..08431bc5e3d4e8715b2106ee00512910b8fa2291 100644
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
@@ -6,10 +6,11 @@ library test.integration.analysis.get.hover;
import 'dart:async';
-import '../../reflective_tests.dart';
+import 'package:analysis_server/src/protocol.dart';
import 'package:path/path.dart';
import 'package:unittest/unittest.dart';
+import '../../reflective_tests.dart';
import '../integration_tests.dart';
@ReflectiveTestCase()
@@ -111,49 +112,49 @@ main() {
null, propagatedType: null}) {
int offset = text.indexOf(target);
return sendAnalysisGetHover(pathname, offset).then((result) {
- expect(result['hovers'], hasLength(1));
- var info = result['hovers'][0];
- expect(info['offset'], equals(offset));
- expect(info['length'], equals(length));
+ expect(result.hovers, hasLength(1));
+ HoverInformation info = result.hovers[0];
+ expect(info.offset, equals(offset));
+ expect(info.length, equals(length));
if (isCore) {
- expect(basename(info['containingLibraryPath']), equals('core.dart'));
- expect(info['containingLibraryName'], equals('dart.core'));
+ expect(basename(info.containingLibraryPath), equals('core.dart'));
+ expect(info.containingLibraryName, equals('dart.core'));
} else if (isLiteral) {
- expect(info['containingLibraryPath'], isNull);
- expect(info['containingLibraryName'], isNull);
+ expect(info.containingLibraryPath, isNull);
+ expect(info.containingLibraryName, isNull);
} else {
- expect(info['containingLibraryPath'], equals(pathname));
- expect(info['containingLibraryName'], equals('lib.test'));
+ expect(info.containingLibraryPath, equals(pathname));
+ expect(info.containingLibraryName, equals('lib.test'));
}
if (docRegexp == null) {
- expect(info['dartdoc'], isNull);
+ expect(info.dartdoc, isNull);
} else {
- expect(info['dartdoc'], matches(docRegexp));
+ expect(info.dartdoc, matches(docRegexp));
}
if (descriptionRegexps == null) {
- expect(info['elementDescription'], isNull);
+ expect(info.elementDescription, isNull);
} else {
- expect(info['elementDescription'], isString);
+ expect(info.elementDescription, isString);
for (String descriptionRegexp in descriptionRegexps) {
- expect(info['elementDescription'], matches(descriptionRegexp));
+ expect(info.elementDescription, matches(descriptionRegexp));
}
}
- expect(info['elementKind'], equals(kind));
+ expect(info.elementKind, equals(kind));
if (parameterRegexps == null) {
- expect(info['parameter'], isNull);
+ expect(info.parameter, isNull);
} else {
- expect(info['parameter'], isString);
+ expect(info.parameter, isString);
for (String parameterRegexp in parameterRegexps) {
- expect(info['parameter'], matches(parameterRegexp));
+ expect(info.parameter, matches(parameterRegexp));
}
}
- expect(info['propagatedType'], equals(propagatedType));
+ expect(info.propagatedType, equals(propagatedType));
if (staticTypeRegexps == null) {
- expect(info['staticType'], isNull);
+ expect(info.staticType, isNull);
} else {
- expect(info['staticType'], isString);
+ expect(info.staticType, isString);
for (String staticTypeRegexp in staticTypeRegexps) {
- expect(info['staticType'], matches(staticTypeRegexp));
+ expect(info.staticType, matches(staticTypeRegexp));
}
}
});
@@ -166,7 +167,7 @@ main() {
Future checkNoHover(String target) {
int offset = text.indexOf(target);
return sendAnalysisGetHover(pathname, offset).then((result) {
- expect(result['hovers'], hasLength(0));
+ expect(result.hovers, hasLength(0));
});
}
}

Powered by Google App Engine
This is Rietveld 408576698