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

Unified Diff: pkg/analyzer/test/src/summary/index_unit_test.dart

Issue 1896023005: Issue 26207. Fix for renaming top-level functions with offset 0. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/analyzer/lib/src/summary/index_unit.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/index_unit_test.dart
diff --git a/pkg/analyzer/test/src/summary/index_unit_test.dart b/pkg/analyzer/test/src/summary/index_unit_test.dart
index cb18d02233e3d2a8ab4e3372974c29f47b9110a6..9a269b0b5b2d4097cf699fb6d08bce267f822009 100644
--- a/pkg/analyzer/test/src/summary/index_unit_test.dart
+++ b/pkg/analyzer/test/src/summary/index_unit_test.dart
@@ -819,6 +819,26 @@ main() {
..isInvokedAt('foo());', false);
}
+ void test_isReferencedBy_FunctionElement_with_LibraryElement() {
+ addSource(
+ '/foo.dart',
+ r'''
+bar() {}
+''');
+ _indexTestUnit('''
+import "foo.dart";
+main() {
+ bar();
+}
+''');
+ LibraryElement fooLibrary = testLibraryElement.imports[0].importedLibrary;
+ assertThat(fooLibrary)..isReferencedAt('"foo.dart";', true, length: 10);
+ {
+ FunctionElement bar = fooLibrary.definingCompilationUnit.functions[0];
+ assertThat(bar)..isInvokedAt('bar();', false);
+ }
+ }
+
void test_isReferencedBy_FunctionTypeAliasElement() {
_indexTestUnit('''
typedef A();
« no previous file with comments | « pkg/analyzer/lib/src/summary/index_unit.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698