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

Unified Diff: pkg/analysis_server/test/integration/search/find_element_references_test.dart

Issue 2844273003: Unify the server and plugin versions of the generators (Closed)
Patch Set: add missed files Created 3 years, 8 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
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 {

Powered by Google App Engine
This is Rietveld 408576698