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 965a37fd7e1d11ddaa2a5ac9947387ed933b5c80..10461577232f440a32d4da40d2273fc52436dc31 100644 |
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart |
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart |
@@ -18,8 +18,8 @@ main() { |
} |
@reflectiveTest |
-class AnalysisGetHoverIntegrationTest extends |
- AbstractAnalysisServerIntegrationTest { |
+class AnalysisGetHoverIntegrationTest |
+ extends AbstractAnalysisServerIntegrationTest { |
/** |
* Pathname of the file containing Dart code. |
*/ |
@@ -63,8 +63,8 @@ main() { |
*/ |
checkHover(String target, int length, List<String> descriptionRegexps, |
String kind, List<String> staticTypeRegexps, {bool isCore: false, |
- String docRegexp: null, bool isLiteral: false, List<String> parameterRegexps: |
- null, propagatedType: null}) { |
+ String docRegexp: null, bool isLiteral: false, |
+ List<String> parameterRegexps: null, propagatedType: null}) { |
int offset = text.indexOf(target); |
return sendAnalysisGetHover(pathname, offset).then((result) { |
expect(result.hovers, hasLength(1)); |
@@ -141,124 +141,54 @@ main() { |
// request is made. So wait for analysis to finish before testing anything. |
return analysisFinished.then((_) { |
List<Future> tests = []; |
- tests.add( |
- checkHover( |
- 'topLevelVar;', |
- 11, |
- ['List', 'topLevelVar'], |
- 'top level variable', |
- ['List'])); |
- tests.add( |
- checkHover( |
- 'func(', |
- 4, |
- ['func', 'int', 'param'], |
- 'function', |
- ['int', 'void'], |
- docRegexp: 'Documentation for func')); |
- tests.add( |
- checkHover( |
- 'int param', |
- 3, |
- ['int'], |
- 'class', |
- ['int'], |
- isCore: true, |
- docRegexp: '.*')); |
- tests.add( |
- checkHover( |
- 'param)', |
- 5, |
- ['int', 'param'], |
- 'parameter', |
- ['int'], |
- docRegexp: 'Documentation for func')); |
- tests.add( |
- checkHover( |
- 'num localVar', |
- 3, |
- ['num'], |
- 'class', |
- ['num'], |
- isCore: true, |
- docRegexp: '.*')); |
- tests.add( |
- checkHover( |
- 'localVar =', |
- 8, |
- ['num', 'localVar'], |
- 'local variable', |
- ['num'], |
- propagatedType: 'int')); |
- tests.add( |
- checkHover( |
- 'topLevelVar.length;', |
- 11, |
- ['List', 'topLevelVar'], |
- 'top level variable', |
- ['List'])); |
- tests.add( |
- checkHover( |
- 'length;', |
- 6, |
- ['get', 'length', 'int'], |
- 'getter', |
- ['int'], |
- isCore: true, |
- docRegexp: '.*')); |
- tests.add( |
- checkHover( |
- 'length =', |
- 6, |
- ['set', 'length', 'int'], |
- 'setter', |
- ['int'], |
- isCore: true, |
- docRegexp: '.*')); |
- tests.add( |
- checkHover( |
- 'param;', |
- 5, |
- ['int', 'param'], |
- 'parameter', |
- ['int'], |
- docRegexp: 'Documentation for func', |
- parameterRegexps: ['.*'])); |
- tests.add( |
- checkHover( |
- 'add(', |
- 3, |
- ['List', 'add'], |
- 'method', |
- null, |
- isCore: true, |
- docRegexp: '.*')); |
- tests.add( |
- checkHover( |
- 'localVar)', |
- 8, |
- ['num', 'localVar'], |
- 'local variable', |
- ['num'], |
- parameterRegexps: ['.*'], |
- propagatedType: 'int')); |
- tests.add( |
- checkHover( |
- 'func(35', |
- 4, |
- ['func', 'int', 'param'], |
- 'function', |
- null, |
- docRegexp: 'Documentation for func')); |
- tests.add( |
- checkHover( |
- '35', |
- 2, |
- null, |
- null, |
- ['int'], |
- isLiteral: true, |
- parameterRegexps: ['int', 'param'])); |
+ tests.add(checkHover('topLevelVar;', 11, |
+ ['List', 'topLevelVar'], 'top level variable', ['List'])); |
+ tests.add(checkHover('func(', 4, [ |
+ 'func', |
+ 'int', |
+ 'param' |
+ ], 'function', ['int', 'void'], docRegexp: 'Documentation for func')); |
+ tests.add(checkHover('int param', 3, ['int'], 'class', ['int'], |
+ isCore: true, docRegexp: '.*')); |
+ tests.add(checkHover('param)', 5, ['int', 'param'], 'parameter', ['int'], |
+ docRegexp: 'Documentation for func')); |
+ tests.add(checkHover('num localVar', 3, ['num'], 'class', ['num'], |
+ isCore: true, docRegexp: '.*')); |
+ tests.add(checkHover('localVar =', 8, [ |
+ 'num', |
+ 'localVar' |
+ ], 'local variable', ['num'], propagatedType: 'int')); |
+ tests.add(checkHover('topLevelVar.length;', 11, [ |
+ 'List', |
+ 'topLevelVar' |
+ ], 'top level variable', ['List'])); |
+ tests.add(checkHover('length;', 6, [ |
+ 'get', |
+ 'length', |
+ 'int' |
+ ], 'getter', ['int'], isCore: true, docRegexp: '.*')); |
+ tests.add(checkHover('length =', 6, [ |
+ 'set', |
+ 'length', |
+ 'int' |
+ ], 'setter', ['int'], isCore: true, docRegexp: '.*')); |
+ tests.add(checkHover('param;', 5, ['int', 'param'], 'parameter', ['int'], |
+ docRegexp: 'Documentation for func', parameterRegexps: ['.*'])); |
+ tests.add(checkHover('add(', 3, ['List', 'add'], 'method', null, |
+ isCore: true, docRegexp: '.*')); |
+ tests.add(checkHover('localVar)', 8, [ |
+ 'num', |
+ 'localVar' |
+ ], 'local variable', [ |
+ 'num' |
+ ], parameterRegexps: ['.*'], propagatedType: 'int')); |
+ tests.add(checkHover('func(35', 4, [ |
+ 'func', |
+ 'int', |
+ 'param' |
+ ], 'function', null, docRegexp: 'Documentation for func')); |
+ tests.add(checkHover('35', 2, null, null, ['int'], |
+ isLiteral: true, parameterRegexps: ['int', 'param'])); |
tests.add(checkNoHover('comment')); |
return Future.wait(tests); |
}); |