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

Side by Side Diff: pkg/analysis_server/test/services/index/dart_index_contributor_test.dart

Issue 685493003: Index EnumDeclaration definitions as top-level elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/test/abstract_context.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 library test.services.src.index.dart_index_contributor; 5 library test.services.src.index.dart_index_contributor;
6 6
7 import 'package:analysis_server/src/services/index/index.dart'; 7 import 'package:analysis_server/src/services/index/index.dart';
8 import 'package:analysis_server/src/services/index/index_contributor.dart'; 8 import 'package:analysis_server/src/services/index/index_contributor.dart';
9 import 'package:analysis_server/src/services/index/index_store.dart'; 9 import 'package:analysis_server/src/services/index/index_store.dart';
10 import 'package:analyzer/src/generated/ast.dart'; 10 import 'package:analyzer/src/generated/ast.dart';
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 void test_definesClass() { 291 void test_definesClass() {
292 _indexTestUnit('class A {}'); 292 _indexTestUnit('class A {}');
293 // prepare elements 293 // prepare elements
294 ClassElement classElement = findElement("A"); 294 ClassElement classElement = findElement("A");
295 // verify 295 // verify
296 _assertDefinesTopLevelElement( 296 _assertDefinesTopLevelElement(
297 IndexConstants.DEFINES, 297 IndexConstants.DEFINES,
298 _expectedLocation(classElement, 'A {}')); 298 _expectedLocation(classElement, 'A {}'));
299 } 299 }
300 300
301 void test_definesClassEnum() {
302 _indexTestUnit('enum MyEnum {A, B, c}');
303 // prepare elements
304 ClassElement classElement = findElement("MyEnum");
305 // verify
306 _assertDefinesTopLevelElement(
307 IndexConstants.DEFINES,
308 _expectedLocation(classElement, 'MyEnum {'));
309 }
310
301 void test_definesClassAlias() { 311 void test_definesClassAlias() {
302 _indexTestUnit(''' 312 _indexTestUnit('''
303 class Mix {} 313 class Mix {}
304 class MyClass = Object with Mix;'''); 314 class MyClass = Object with Mix;''');
305 // prepare elements 315 // prepare elements
306 Element classElement = findElement("MyClass"); 316 Element classElement = findElement("MyClass");
307 // verify 317 // verify
308 _assertDefinesTopLevelElement( 318 _assertDefinesTopLevelElement(
309 IndexConstants.DEFINES, 319 IndexConstants.DEFINES,
310 _expectedLocation(classElement, 'MyClass =')); 320 _expectedLocation(classElement, 'MyClass ='));
(...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 1755
1746 RecordedRelation(this.element, this.relationship, this.location); 1756 RecordedRelation(this.element, this.relationship, this.location);
1747 1757
1748 @override 1758 @override
1749 String toString() { 1759 String toString() {
1750 return 'RecordedRelation(element=$element; relationship=$relationship; ' 1760 return 'RecordedRelation(element=$element; relationship=$relationship; '
1751 'location=$location; flags=' '${location.isQualified ? "Q" : ""}' 1761 'location=$location; flags=' '${location.isQualified ? "Q" : ""}'
1752 '${location.isResolved ? "R" : ""})'; 1762 '${location.isResolved ? "R" : ""})';
1753 } 1763 }
1754 } 1764 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/abstract_context.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698