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

Side by Side Diff: pkg/analysis_server/test/search/element_references_test.dart

Issue 2868233003: Remove unnecessary tests (Closed)
Patch Set: Created 3 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
« no previous file with comments | « pkg/analysis_server/test/edit/refactoring_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:analysis_server/protocol/protocol.dart'; 7 import 'package:analysis_server/protocol/protocol.dart';
8 import 'package:analysis_server/protocol/protocol_generated.dart'; 8 import 'package:analysis_server/protocol/protocol_generated.dart';
9 import 'package:analysis_server/src/services/index/index.dart';
10 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
11 import 'package:test_reflective_loader/test_reflective_loader.dart'; 10 import 'package:test_reflective_loader/test_reflective_loader.dart';
12 11
13 import 'abstract_search_domain.dart'; 12 import 'abstract_search_domain.dart';
14 13
15 main() { 14 main() {
16 defineReflectiveSuite(() { 15 defineReflectiveSuite(() {
17 defineReflectiveTests(ElementReferencesTest); 16 defineReflectiveTests(ElementReferencesTest);
18 defineReflectiveTests(_NoSearchEngine);
19 }); 17 });
20 } 18 }
21 19
22 @reflectiveTest 20 @reflectiveTest
23 class ElementReferencesTest extends AbstractSearchDomainTest { 21 class ElementReferencesTest extends AbstractSearchDomainTest {
24 Element searchElement; 22 Element searchElement;
25 23
26 void assertHasRef(SearchResultKind kind, String search, bool isPotential) { 24 void assertHasRef(SearchResultKind kind, String search, bool isPotential) {
27 assertHasResult(kind, search); 25 assertHasResult(kind, search);
28 expect(result.isPotential, isPotential); 26 expect(result.isPotential, isPotential);
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
665 T m() => null; 663 T m() => null;
666 } 664 }
667 '''); 665 ''');
668 await findElementReferences('T> {', false); 666 await findElementReferences('T> {', false);
669 expect(searchElement.kind, ElementKind.TYPE_PARAMETER); 667 expect(searchElement.kind, ElementKind.TYPE_PARAMETER);
670 expect(results, hasLength(2)); 668 expect(results, hasLength(2));
671 assertHasResult(SearchResultKind.REFERENCE, 'T f;'); 669 assertHasResult(SearchResultKind.REFERENCE, 'T f;');
672 assertHasResult(SearchResultKind.REFERENCE, 'T m()'); 670 assertHasResult(SearchResultKind.REFERENCE, 'T m()');
673 } 671 }
674 } 672 }
675
676 @reflectiveTest
677 class _NoSearchEngine extends AbstractSearchDomainTest {
678 @override
679 Index createIndex() {
680 return null;
681 }
682
683 test_requestError_noSearchEngine() async {
684 addTestFile('''
685 main() {
686 var vvv = 1;
687 print(vvv);
688 }
689 ''');
690 Request request = new SearchFindElementReferencesParams(testFile, 0, false)
691 .toRequest('0');
692 Response response = await waitResponse(request);
693 expect(response.error, isNotNull);
694 expect(response.error.code, RequestErrorCode.NO_INDEX_GENERATED);
695 }
696 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/edit/refactoring_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698