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

Unified Diff: pkg/analysis_server/test/services/index/index_test.dart

Issue 1854683003: Issue 26167. Test for indexing a unit which is not attached to a library. (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 | « no previous file | 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/index/index_test.dart
diff --git a/pkg/analysis_server/test/services/index/index_test.dart b/pkg/analysis_server/test/services/index/index_test.dart
index 17874073a0e676953f358b57bbc18b7f99f7d888..a99d34aba8069db5845a5ff29b8373ce3311ab08 100644
--- a/pkg/analysis_server/test/services/index/index_test.dart
+++ b/pkg/analysis_server/test/services/index/index_test.dart
@@ -8,6 +8,7 @@ import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/summary/idl.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
+import 'package:typed_mock/typed_mock.dart';
import 'package:unittest/unittest.dart';
import '../../abstract_single_unit.dart';
@@ -257,6 +258,14 @@ class A {
index.indexDeclarations(testUnit);
}
+ test_indexUnit_nullLibraryElement() async {
+ resolveTestUnit('');
+ CompilationUnitElement unitElement = new _CompilationUnitElementMock();
+ expect(unitElement.library, isNull);
+ testUnit.element = unitElement;
+ index.indexUnit(testUnit);
+ }
+
test_indexUnit_nullUnit() async {
index.indexUnit(null);
}
@@ -341,3 +350,6 @@ class A {}
return source;
}
}
+
+class _CompilationUnitElementMock extends TypedMock
+ implements CompilationUnitElement {}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698