| 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 a8a3f4f042604c99bfb629718e1fa6c46d160c48..6cf35206dd32082de6484f2e21c09a78186a1a96 100644
|
| --- a/pkg/analyzer/test/src/summary/index_unit_test.dart
|
| +++ b/pkg/analyzer/test/src/summary/index_unit_test.dart
|
| @@ -908,6 +908,22 @@ class A {
|
| ..isWrittenAt('field = 5', true);
|
| }
|
|
|
| + void test_usedName_inLibraryIdentifier() {
|
| + verifyNoTestUnitErrors = false;
|
| + _indexTestUnit('''
|
| +library aaa.bbb.ccc;
|
| +class C {
|
| + var bbb;
|
| +}
|
| +main(p) {
|
| + p.bbb = 1;
|
| +}
|
| +''');
|
| + assertThatName('bbb')
|
| + ..isNotUsed('bbb.ccc', IndexRelationKind.IS_READ_BY)
|
| + ..isUsedQ('bbb = 1;', IndexRelationKind.IS_WRITTEN_BY);
|
| + }
|
| +
|
| void test_usedName_qualified_resolved() {
|
| verifyNoTestUnitErrors = false;
|
| _indexTestUnit('''
|
| @@ -922,10 +938,10 @@ main(C c) {
|
| }
|
| ''');
|
| assertThatName('x')
|
| - ..isNotUsed('x;', IndexRelationKind.IS_READ_BY)
|
| - ..isNotUsed('x = 1;', IndexRelationKind.IS_WRITTEN_BY)
|
| - ..isNotUsed('x += 2;', IndexRelationKind.IS_READ_WRITTEN_BY)
|
| - ..isNotUsed('x();', IndexRelationKind.IS_INVOKED_BY);
|
| + ..isNotUsedQ('x;', IndexRelationKind.IS_READ_BY)
|
| + ..isNotUsedQ('x = 1;', IndexRelationKind.IS_WRITTEN_BY)
|
| + ..isNotUsedQ('x += 2;', IndexRelationKind.IS_READ_WRITTEN_BY)
|
| + ..isNotUsedQ('x();', IndexRelationKind.IS_INVOKED_BY);
|
| }
|
|
|
| void test_usedName_qualified_unresolved() {
|
| @@ -959,10 +975,10 @@ class C {
|
| }
|
| ''');
|
| assertThatName('x')
|
| - ..isNotUsed('x;', IndexRelationKind.IS_READ_BY)
|
| - ..isNotUsed('x = 1;', IndexRelationKind.IS_WRITTEN_BY)
|
| - ..isNotUsed('x += 2;', IndexRelationKind.IS_READ_WRITTEN_BY)
|
| - ..isNotUsed('x();', IndexRelationKind.IS_INVOKED_BY);
|
| + ..isNotUsedQ('x;', IndexRelationKind.IS_READ_BY)
|
| + ..isNotUsedQ('x = 1;', IndexRelationKind.IS_WRITTEN_BY)
|
| + ..isNotUsedQ('x += 2;', IndexRelationKind.IS_READ_WRITTEN_BY)
|
| + ..isNotUsedQ('x();', IndexRelationKind.IS_INVOKED_BY);
|
| }
|
|
|
| void test_usedName_unqualified_unresolved() {
|
| @@ -1201,6 +1217,11 @@ class _NameIndexAssert {
|
|
|
| void isNotUsed(String search, IndexRelationKind kind) {
|
| test._assertUsedName(
|
| + name, kind, test._expectedLocation(search, false), true);
|
| + }
|
| +
|
| + void isNotUsedQ(String search, IndexRelationKind kind) {
|
| + test._assertUsedName(
|
| name, kind, test._expectedLocation(search, true), true);
|
| }
|
|
|
|
|