| Index: pkg/analysis_server/test/services/index/store/codec_test.dart
|
| diff --git a/pkg/analysis_server/test/services/index/store/codec_test.dart b/pkg/analysis_server/test/services/index/store/codec_test.dart
|
| index 0602066c9b8db557ebc7af381c2de161a5fd31ea..9903b1f72bf651c8a7cc3fb4db4368768c3dbd8c 100644
|
| --- a/pkg/analysis_server/test/services/index/store/codec_test.dart
|
| +++ b/pkg/analysis_server/test/services/index/store/codec_test.dart
|
| @@ -19,7 +19,6 @@ main() {
|
| groupSep = ' | ';
|
| runReflectiveTests(_ContextCodecTest);
|
| runReflectiveTests(_ElementCodecTest);
|
| - runReflectiveTests(_ElementKindCodecTest);
|
| runReflectiveTests(_RelationshipCodecTest);
|
| runReflectiveTests(_StringCodecTest);
|
| }
|
| @@ -147,9 +146,12 @@ main() {
|
| int id = codec.encode(element, false);
|
| expect(codec.decode(context, id), element);
|
| }
|
| - // check strings, only source encoding
|
| - expect(stringCodec.nameToIndex, hasLength(1));
|
| + // check strings, "foo" as a single string, no "foo@17" or "bar@35"
|
| + expect(stringCodec.nameToIndex, hasLength(4));
|
| expect(stringCodec.nameToIndex, containsPair('file:///test.dart', 0));
|
| + expect(stringCodec.nameToIndex, containsPair('main', 1));
|
| + expect(stringCodec.nameToIndex, containsPair('foo', 2));
|
| + expect(stringCodec.nameToIndex, containsPair('bar', 3));
|
| }
|
|
|
| void test_localVariable() {
|
| @@ -173,16 +175,11 @@ main() {
|
| int id = codec.encode(element, false);
|
| expect(codec.decode(context, id), element);
|
| }
|
| - // check strings, only source encoding
|
| - expect(stringCodec.nameToIndex, hasLength(1));
|
| + // check strings, "foo" as a single string, no "foo@21" or "foo@47"
|
| + expect(stringCodec.nameToIndex, hasLength(3));
|
| expect(stringCodec.nameToIndex, containsPair('file:///test.dart', 0));
|
| - }
|
| -
|
| - void test_name() {
|
| - Element element = new NameElement('myName');
|
| - int id = codec.encode(element, false);
|
| - // we don't need decoding - it is never used as a location
|
| - expect(codec.decode(null, id), null);
|
| + expect(stringCodec.nameToIndex, containsPair('main', 1));
|
| + expect(stringCodec.nameToIndex, containsPair('foo', 2));
|
| }
|
|
|
| void test_notLocal() {
|
| @@ -196,24 +193,10 @@ main() {
|
| expect(codec.encode(element, false), id);
|
| expect(codec.decode(context, id), element);
|
| // check strings
|
| - expect(stringCodec.nameToIndex, hasLength(1));
|
| + expect(stringCodec.nameToIndex, hasLength(3));
|
| expect(stringCodec.nameToIndex, containsPair('file:///test.dart', 0));
|
| - }
|
| -}
|
| -
|
| -
|
| -@ReflectiveTestCase()
|
| -class _ElementKindCodecTest {
|
| - ElementKindCodec codec = new ElementKindCodec();
|
| -
|
| - void test_decode_unknown() {
|
| - expect(codec.decode(1 << 20), isNull);
|
| - }
|
| -
|
| - void test_encodeDecode() {
|
| - int idClass = codec.encode(ElementKind.CLASS);
|
| - int idMethod = codec.encode(ElementKind.METHOD);
|
| - expect(idClass, isNot(idMethod));
|
| + expect(stringCodec.nameToIndex, containsPair('main', 1));
|
| + expect(stringCodec.nameToIndex, containsPair('foo', 2));
|
| }
|
| }
|
|
|
|
|