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

Unified Diff: pkg/analysis_server/test/services/index2/index2_test.dart

Issue 1778113002: Separate index objects for each analysis context. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/lib/src/services/index2/index2.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/test/services/index2/index2_test.dart
diff --git a/pkg/analysis_server/test/services/index2/index2_test.dart b/pkg/analysis_server/test/services/index2/index2_test.dart
index 5a9abb0e66c8927ff8efe05361c3a40dd88b62cc..a23d0c4fa84527293067e6d96b167dc1a605bc60 100644
--- a/pkg/analysis_server/test/services/index2/index2_test.dart
+++ b/pkg/analysis_server/test/services/index2/index2_test.dart
@@ -180,6 +180,29 @@ main(A a, p) {
findLocationTest(locations, 'test); // p-ref-ur-q');
}
+ test_indexUnit_nullUnit() async {
+ index.indexUnit(null);
+ }
+
+ test_indexUnit_nullUnitElement() async {
+ resolveTestUnit('');
+ testUnit.element = null;
+ index.indexUnit(testUnit);
+ }
+
+ test_removeContext() async {
+ _indexTestUnit('''
+class A {}
+''');
+ RegExp regExp = new RegExp(r'^A$');
+ expect(await index.getDefinedNames(regExp, IndexNameKind.topLevel),
+ hasLength(1));
+ // remove the context - no
+ index.removeContext(context);
+ expect(
+ await index.getDefinedNames(regExp, IndexNameKind.topLevel), isEmpty);
+ }
+
/**
* Assert that the given list of [locations] has a [Location] corresponding
* to the [element].
« no previous file with comments | « pkg/analysis_server/lib/src/services/index2/index2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698