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

Side by Side Diff: pkg/analysis_server/test/services/search/search_engine_test.dart

Issue 1947813002: More strong mode clean-up (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library test.services.src.search.search_engine_internal; 5 library test.services.src.search.search_engine_internal;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/services/index/index.dart'; 9 import 'package:analysis_server/src/services/index/index.dart';
10 import 'package:analysis_server/src/services/search/search_engine.dart'; 10 import 'package:analysis_server/src/services/search/search_engine.dart';
(...skipping 18 matching lines...) Expand all
29 final MatchKind kind; 29 final MatchKind kind;
30 SourceRange range; 30 SourceRange range;
31 final bool isResolved; 31 final bool isResolved;
32 final bool isQualified; 32 final bool isQualified;
33 33
34 ExpectedMatch(this.element, this.kind, int offset, int length, 34 ExpectedMatch(this.element, this.kind, int offset, int length,
35 {this.isResolved: true, this.isQualified: false}) { 35 {this.isResolved: true, this.isQualified: false}) {
36 this.range = new SourceRange(offset, length); 36 this.range = new SourceRange(offset, length);
37 } 37 }
38 38
39 bool operator ==(SearchMatch match) { 39 bool operator ==(Object match) {
40 return match.element == this.element && 40 return match is SearchMatch &&
41 match.element == this.element &&
41 match.kind == this.kind && 42 match.kind == this.kind &&
42 match.isResolved == this.isResolved && 43 match.isResolved == this.isResolved &&
43 match.isQualified == this.isQualified && 44 match.isQualified == this.isQualified &&
44 match.sourceRange == this.range; 45 match.sourceRange == this.range;
45 } 46 }
46 47
47 @override 48 @override
48 String toString() { 49 String toString() {
49 StringBuffer buffer = new StringBuffer(); 50 StringBuffer buffer = new StringBuffer();
50 buffer.write("ExpectedMatch(kind="); 51 buffer.write("ExpectedMatch(kind=");
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
898 List<SearchMatch> matches = await searchEngine.searchReferences(element); 899 List<SearchMatch> matches = await searchEngine.searchReferences(element);
899 _assertMatches(matches, expectedMatches); 900 _assertMatches(matches, expectedMatches);
900 expect(matches, hasLength(expectedMatches.length)); 901 expect(matches, hasLength(expectedMatches.length));
901 } 902 }
902 903
903 static void _assertMatches( 904 static void _assertMatches(
904 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) { 905 List<SearchMatch> matches, List<ExpectedMatch> expectedMatches) {
905 expect(matches, unorderedEquals(expectedMatches)); 906 expect(matches, unorderedEquals(expectedMatches));
906 } 907 }
907 } 908 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/integration/integration_tests.dart ('k') | pkg/analyzer/lib/src/cancelable_future.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698