Index: pkg/analysis_server/test/search/top_level_declarations_test.dart |
diff --git a/pkg/analysis_server/test/search/top_level_declarations_test.dart b/pkg/analysis_server/test/search/top_level_declarations_test.dart |
index 81fa08b749478c62191201a78d2db826a4988f2f..ce4cb32270271fcbbfb2c4a0d54620940e53ec9f 100644 |
--- a/pkg/analysis_server/test/search/top_level_declarations_test.dart |
+++ b/pkg/analysis_server/test/search/top_level_declarations_test.dart |
@@ -39,6 +39,9 @@ class TopLevelDeclarationsTest extends AbstractSearchDomainTest { |
Request request = |
new SearchFindTopLevelDeclarationsParams(pattern).toRequest('0'); |
Response response = await waitResponse(request); |
+ if (response.error != null) { |
+ return response.error; |
+ } |
searchId = |
new SearchFindTopLevelDeclarationsResult.fromResponse(response).id; |
return waitForSearchResults(); |
@@ -54,7 +57,9 @@ class TopLevelDeclarationsTest extends AbstractSearchDomainTest { |
return null; |
} |
- test_startEndPattern() async { |
+ setUp() { |
+ super.setUp(); |
+ |
addTestFile(''' |
scheglov
2016/07/14 00:18:07
This test file is specifically for the correspondi
|
class A {} // A |
class B = Object with A; |
@@ -63,6 +68,9 @@ D() {} |
var E = null; |
class ABC {} |
'''); |
+ } |
+ |
+ test_startEndPattern() async { |
await findTopLevelDeclarations('^[A-E]\$'); |
assertHasDeclaration(ElementKind.CLASS, 'A'); |
assertHasDeclaration(ElementKind.CLASS, 'B'); |
@@ -71,4 +79,9 @@ class ABC {} |
assertHasDeclaration(ElementKind.TOP_LEVEL_VARIABLE, 'E'); |
assertNoDeclaration(ElementKind.CLASS, 'ABC'); |
} |
+ |
+ test_invalidRegex() async { |
+ var result = await findTopLevelDeclarations('[A'); |
+ expect(true, result is RequestError); |
Brian Wilkerson
2016/07/13 23:42:37
The arguments are backward. The better way to writ
scheglov
2016/07/14 00:18:07
See also isResponseFailure in mocks.dart
|
+ } |
} |