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

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

Issue 1054063002: Fix 'getHover' integration test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 10461577232f440a32d4da40d2273fc52436dc31..7b5be4d6df1ca5b3a866984cc97a7a505a773721 100644
--- a/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/get_hover_test.dart
@@ -62,8 +62,8 @@ main() {
* expected propagated type of the element.
*/
checkHover(String target, int length, List<String> descriptionRegexps,
- String kind, List<String> staticTypeRegexps, {bool isCore: false,
- String docRegexp: null, bool isLiteral: false,
+ String kind, List<String> staticTypeRegexps, {bool isLocal: false,
+ bool isCore: false, String docRegexp: null, bool isLiteral: false,
List<String> parameterRegexps: null, propagatedType: null}) {
int offset = text.indexOf(target);
return sendAnalysisGetHover(pathname, offset).then((result) {
@@ -74,7 +74,7 @@ main() {
if (isCore) {
expect(basename(info.containingLibraryPath), equals('core.dart'));
expect(info.containingLibraryName, equals('dart.core'));
- } else if (isLiteral) {
+ } else if (isLocal || isLiteral) {
expect(info.containingLibraryPath, isNull);
expect(info.containingLibraryName, isNull);
} else {
@@ -141,52 +141,44 @@ 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('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'));
+ isLocal: true, 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(
+ 'localVar =', 8, ['num', 'localVar'], 'local variable', ['num'],
+ isLocal: true, 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(
+ '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: ['.*']));
+ isLocal: true,
+ 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(
+ 'localVar)', 8, ['num', 'localVar'], 'local variable', ['num'],
+ isLocal: true, 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'));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698