Index: pkg/analysis_server/test/integration/search/find_top_level_declarations_test.dart |
diff --git a/pkg/analysis_server/test/integration/search/find_top_level_declarations_test.dart b/pkg/analysis_server/test/integration/search/find_top_level_declarations_test.dart |
index dd2d333474ed766bdfd651ce2ab6c91dda121116..66352f892d2c55a14cb38d57980bfdfe33e6a965 100644 |
--- a/pkg/analysis_server/test/integration/search/find_top_level_declarations_test.dart |
+++ b/pkg/analysis_server/test/integration/search/find_top_level_declarations_test.dart |
@@ -43,10 +43,14 @@ class Foo { |
expect(searchParams.isLast, isTrue); |
expect(searchParams.results, isNotEmpty); |
- SearchResult result = searchParams.results.first; |
- expect(result.location.file, pathname); |
- expect(result.isPotential, isFalse); |
- expect(result.kind.name, SearchResultKind.DECLARATION.name); |
- expect(result.path.first.name, 'qux'); |
+ for (SearchResult result in searchParams.results) { |
+ if (result.location.file == pathname) { |
+ expect(result.isPotential, isFalse); |
+ expect(result.kind.name, SearchResultKind.DECLARATION.name); |
+ expect(result.path.first.name, 'qux'); |
+ return; |
+ } |
+ } |
+ fail('No result for $pathname'); |
} |
} |