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..8b1829c8e2e7a7af7e115e8e8f1febd268c75241 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(); |
@@ -71,4 +74,9 @@ class ABC {} |
assertHasDeclaration(ElementKind.TOP_LEVEL_VARIABLE, 'E'); |
assertNoDeclaration(ElementKind.CLASS, 'ABC'); |
} |
+ |
+ test_invalidRegex() async { |
+ var result = await findTopLevelDeclarations('[A'); |
+ expect(result, new isInstanceOf<RequestError>()); |
+ } |
} |