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

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

Issue 576443002: Search for LabelElement and icon for LABEL in Editor. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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/element_references.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/element_references_test.dart
diff --git a/pkg/analysis_server/test/search/element_references_test.dart b/pkg/analysis_server/test/search/element_references_test.dart
index 8bf11a95641b5696ecb27641f563b99c0a6ad303..560e5dee011583f44d3f0c589d4bd15161e783e6 100644
--- a/pkg/analysis_server/test/search/element_references_test.dart
+++ b/pkg/analysis_server/test/search/element_references_test.dart
@@ -297,6 +297,27 @@ main(A a, B b, C c) {
});
}
+ test_label() {
+ addTestFile('''
+main() {
+myLabel:
+ for (int i = 0; i < 10; i++) {
+ if (i == 2) {
+ continue myLabel; // continue
+ }
+ break myLabel; // break
+ }
+}
+''');
+ return findElementReferences('myLabel; // break', false).then((_) {
+ expect(searchElement.kind, ElementKind.LABEL);
+ expect(results, hasLength(3));
+ assertHasResult(SearchResultKind.DECLARATION, 'myLabel:');
+ assertHasResult(SearchResultKind.REFERENCE, 'myLabel; // continue');
+ assertHasResult(SearchResultKind.REFERENCE, 'myLabel; // break');
+ });
+ }
+
test_localVariable() {
addTestFile('''
main() {
« no previous file with comments | « pkg/analysis_server/lib/src/search/element_references.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698