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

Side by Side Diff: pkg/analyzer/test/index/local_index_test.dart

Issue 365193004: Move Index and IndexStore implementations into Engine. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library test.engine.src.index;
6
7 //import 'dart:async';
8 //import 'dart:io' show Directory;
9 //
10 //import 'package:analyzer/src/generated/ast.dart';
11 //import 'package:analyzer/src/generated/element.dart';
12 //import 'package:analyzer/src/generated/html.dart';
13 //import 'package:analyzer/src/generated/source_io.dart';
14 //import 'package:unittest/unittest.dart';
15 //
16 //import '../reflective_tests.dart';
17 //import 'store/memory_node_manager.dart';
18 //import 'store/single_source_container.dart';
19 //import 'package:analyzer/src/index/local_index.dart';
20 //import 'package:analyzer/index/index.dart';
21
22
23 main() {
24 // groupSep = ' | ';
25 // group('LocalIndex', () {
26 //// runReflectiveTests(LocalIndexTest);
27 // });
28 }
29
30
31 //void _assertElementNames(List<Location> locations, List expected) {
32 // expect(_toElementNames(locations), unorderedEquals(expected));
33 //}
34 //
35 //
36 //Iterable<String> _toElementNames(List<Location> locations) {
37 // return locations.map((loc) => loc.element.name);
38 //}
39
40
41 /**
42 * TODO(scheglov) Decide what what to do with AbstractContextTest, resource and
43 * all other testing infrastructure existing in Server, but not in Engine.
44 */
45 class LocalIndexTest {}
46 //@ReflectiveTestCase()
47 //class LocalIndexTest extends AbstractContextTest {
48 // Directory indexDirectory;
49 // LocalIndex index;
50 //
51 // void setUp() {
52 // super.setUp();
53 // // prepare Index
54 // indexDirectory = Directory.systemTemp.createTempSync(
55 // 'AnalysisServer_index');
56 // index = new LocalIndex(new MemoryNodeManager());
57 // }
58 //
59 // void tearDown() {
60 // super.tearDown();
61 // indexDirectory.delete(recursive: true);
62 // index = null;
63 // }
64 //
65 // Future test_clear() {
66 // _indexTest('main() {}');
67 // return _getDefinedFunctions().then((locations) {
68 // _assertElementNames(locations, ['main']);
69 // // clear
70 // index.clear();
71 // return _getDefinedFunctions().then((locations) {
72 // expect(locations, isEmpty);
73 // });
74 // });
75 // }
76 //
77 // void test_indexHtmlUnit_nullUnit() {
78 // index.indexHtmlUnit(context, null);
79 // }
80 //
81 // void test_indexHtmlUnit_nullUnitElement() {
82 // HtmlUnit unit = new HtmlUnit(null, [], null);
83 // index.indexHtmlUnit(context, unit);
84 // }
85 //
86 // Future test_indexUnit() {
87 // _indexTest('main() {}');
88 // return _getDefinedFunctions().then((locations) {
89 // _assertElementNames(locations, ['main']);
90 // });
91 // }
92 //
93 // void test_indexUnit_nullUnit() {
94 // index.indexUnit(context, null);
95 // }
96 //
97 // void test_indexUnit_nullUnitElement() {
98 // CompilationUnit unit = new CompilationUnit(null, null, [], [], null);
99 // index.indexUnit(context, unit);
100 // }
101 //
102 // Future test_removeContext() {
103 // _indexTest('main() {}');
104 // return _getDefinedFunctions().then((locations) {
105 // // OK, there is a location
106 // _assertElementNames(locations, ['main']);
107 // // remove context
108 // index.removeContext(context);
109 // return _getDefinedFunctions().then((locations) {
110 // expect(locations, isEmpty);
111 // });
112 // });
113 // }
114 //
115 // Future test_removeSource() {
116 // Source sourceA = _indexLibraryUnit('/testA.dart', 'fa() {}');
117 // _indexLibraryUnit('/testB.dart', 'fb() {}');
118 // return _getDefinedFunctions().then((locations) {
119 // // OK, there are 2 functions
120 // _assertElementNames(locations, ['fa', 'fb']);
121 // // remove source
122 // index.removeSource(context, sourceA);
123 // return _getDefinedFunctions().then((locations) {
124 // _assertElementNames(locations, ['fb']);
125 // });
126 // });
127 // }
128 //
129 // Future test_removeSources() {
130 // Source sourceA = _indexLibraryUnit('/testA.dart', 'fa() {}');
131 // _indexLibraryUnit('/testB.dart', 'fb() {}');
132 // return _getDefinedFunctions().then((locations) {
133 // // OK, there are 2 functions
134 // _assertElementNames(locations, ['fa', 'fb']);
135 // // remove source(s)
136 // index.removeSources(context, new SingleSourceContainer(sourceA));
137 // return _getDefinedFunctions().then((locations) {
138 // _assertElementNames(locations, ['fb']);
139 // });
140 // });
141 // }
142 //
143 // void test_statistics() {
144 // expect(index.statistics, '[0 locations, 0 sources, 0 names]');
145 // }
146 //
147 // Future<List<Location>> _getDefinedFunctions() {
148 // return index.getRelationshipsAsync(UniverseElement.INSTANCE,
149 // IndexConstants.DEFINES_FUNCTION);
150 // }
151 //
152 // Source _indexLibraryUnit(String path, String content) {
153 // Source source = addSource(path, content);
154 // CompilationUnit dartUnit = resolveLibraryUnit(source);
155 // index.indexUnit(context, dartUnit);
156 // return source;
157 // }
158 //
159 // void _indexTest(String content) {
160 // _indexLibraryUnit('/test.dart', content);
161 // }
162 //}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698