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

Side by Side Diff: pkg/analyzer/test/src/dart/analysis/search_test.dart

Issue 2965133003: Move findElementsByName() into shared analyzer/element_search.dart file. (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analyzer/dart/ast/ast.dart'; 7 import 'package:analyzer/dart/ast/ast.dart';
8 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; 8 import 'package:analyzer/dart/ast/standard_resolution_map.dart';
9 import 'package:analyzer/dart/element/element.dart'; 9 import 'package:analyzer/dart/element/element.dart';
10 import 'package:analyzer/src/dart/analysis/driver.dart'; 10 import 'package:analyzer/src/dart/analysis/driver.dart';
11 import 'package:analyzer/src/dart/analysis/search.dart'; 11 import 'package:analyzer/src/dart/analysis/search.dart';
12 import 'package:analyzer/src/dart/ast/utilities.dart'; 12 import 'package:analyzer/src/dart/ast/utilities.dart';
13 import 'package:analyzer/src/dart/element/member.dart'; 13 import 'package:analyzer/src/dart/element/member.dart';
14 import 'package:analyzer/src/generated/testing/element_search.dart';
14 import 'package:test/test.dart'; 15 import 'package:test/test.dart';
15 import 'package:test_reflective_loader/test_reflective_loader.dart'; 16 import 'package:test_reflective_loader/test_reflective_loader.dart';
16 17
17 import '../../../utils.dart';
18 import 'base.dart'; 18 import 'base.dart';
19 19
20 main() { 20 main() {
21 defineReflectiveSuite(() { 21 defineReflectiveSuite(() {
22 defineReflectiveTests(SearchTest); 22 defineReflectiveTests(SearchTest);
23 }); 23 });
24 } 24 }
25 25
26 class ExpectedResult { 26 class ExpectedResult {
27 final Element enclosingElement; 27 final Element enclosingElement;
(...skipping 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 List<SearchResult> results = await driver.search.references(element); 1265 List<SearchResult> results = await driver.search.references(element);
1266 _assertResults(results, expectedMatches); 1266 _assertResults(results, expectedMatches);
1267 expect(results, hasLength(expectedMatches.length)); 1267 expect(results, hasLength(expectedMatches.length));
1268 } 1268 }
1269 1269
1270 static void _assertResults( 1270 static void _assertResults(
1271 List<SearchResult> matches, List<ExpectedResult> expectedMatches) { 1271 List<SearchResult> matches, List<ExpectedResult> expectedMatches) {
1272 expect(matches, unorderedEquals(expectedMatches)); 1272 expect(matches, unorderedEquals(expectedMatches));
1273 } 1273 }
1274 } 1274 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698