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

Unified Diff: pkg/analysis_server/test/search/top_level_declarations_test.dart

Issue 2160723002: Validate the regex used in search.findTopLevelDeclarations. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | « pkg/analysis_server/lib/src/search/search_domain.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>());
+ }
}
« no previous file with comments | « pkg/analysis_server/lib/src/search/search_domain.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698