| Index: pkg/analysis_server/test/integration/search/find_element_references_test.dart
|
| diff --git a/pkg/analysis_server/test/integration/search/find_element_references_test.dart b/pkg/analysis_server/test/integration/search/find_element_references_test.dart
|
| index f847dcfa550e7683c7070a1277c8d03f33d74fc1..10bfbfa6af1e0820905d520a4788da21df4eeac1 100644
|
| --- a/pkg/analysis_server/test/integration/search/find_element_references_test.dart
|
| +++ b/pkg/analysis_server/test/integration/search/find_element_references_test.dart
|
| @@ -4,11 +4,11 @@
|
|
|
| import 'dart:async';
|
|
|
| -import 'package:analysis_server/plugin/protocol/protocol.dart';
|
| +import 'package:analysis_server/protocol/protocol_generated.dart';
|
| import 'package:test/test.dart';
|
| import 'package:test_reflective_loader/test_reflective_loader.dart';
|
|
|
| -import '../integration_tests.dart';
|
| +import '../support/integration_tests.dart';
|
|
|
| main() {
|
| defineReflectiveSuite(() {
|
| @@ -20,10 +20,12 @@ main() {
|
| class FindElementReferencesTest extends AbstractAnalysisServerIntegrationTest {
|
| String pathname;
|
|
|
| - test_findReferences() async {
|
| + test_badTarget() async {
|
| String text = r'''
|
| main() {
|
| - print /* target */ ('Hello');
|
| + if /* target */ (true) {
|
| + print('Hello');
|
| + }
|
| }
|
| ''';
|
|
|
| @@ -33,20 +35,13 @@ main() {
|
| await analysisFinished;
|
|
|
| List<SearchResult> results = await _findElementReferences(text);
|
| - expect(results, hasLength(1));
|
| - SearchResult result = results.first;
|
| - expect(result.location.file, pathname);
|
| - expect(result.isPotential, isFalse);
|
| - expect(result.kind.name, SearchResultKind.INVOCATION.name);
|
| - expect(result.path.first.name, 'main');
|
| + expect(results, isNull);
|
| }
|
|
|
| - test_badTarget() async {
|
| + test_findReferences() async {
|
| String text = r'''
|
| main() {
|
| - if /* target */ (true) {
|
| - print('Hello');
|
| - }
|
| + print /* target */ ('Hello');
|
| }
|
| ''';
|
|
|
| @@ -56,7 +51,12 @@ main() {
|
| await analysisFinished;
|
|
|
| List<SearchResult> results = await _findElementReferences(text);
|
| - expect(results, isNull);
|
| + expect(results, hasLength(1));
|
| + SearchResult result = results.first;
|
| + expect(result.location.file, pathname);
|
| + expect(result.isPotential, isFalse);
|
| + expect(result.kind.name, SearchResultKind.INVOCATION.name);
|
| + expect(result.path.first.name, 'main');
|
| }
|
|
|
| Future<List<SearchResult>> _findElementReferences(String text) async {
|
|
|