| Index: pkg/analysis_server/test/index/split_store_test.dart
|
| diff --git a/pkg/analysis_server/test/index/split_store_test.dart b/pkg/analysis_server/test/index/split_store_test.dart
|
| index f78a6be5844b47754539554df11c900bf3359c1b..038357d86dfb62ae28ae71dba16763a167f1751c 100644
|
| --- a/pkg/analysis_server/test/index/split_store_test.dart
|
| +++ b/pkg/analysis_server/test/index/split_store_test.dart
|
| @@ -70,14 +70,38 @@ void _assertHasLocation(List<Location> locations, Element element, int offset,
|
| class _ContextCodecTest {
|
| ContextCodec codec = new ContextCodec();
|
|
|
| - void test_all() {
|
| + void test_encode_decode() {
|
| AnalysisContext contextA = new _MockAnalysisContext('contextA');
|
| AnalysisContext contextB = new _MockAnalysisContext('contextB');
|
| int idA = codec.encode(contextA);
|
| int idB = codec.encode(contextB);
|
| + expect(idA, codec.encode(contextA));
|
| + expect(idB, codec.encode(contextB));
|
| expect(codec.decode(idA), contextA);
|
| expect(codec.decode(idB), contextB);
|
| }
|
| +
|
| + void test_remove() {
|
| + // encode
|
| + {
|
| + AnalysisContext context = new _MockAnalysisContext('context');
|
| + // encode
|
| + int id = codec.encode(context);
|
| + expect(id, 0);
|
| + expect(codec.decode(id), context);
|
| + // remove
|
| + codec.remove(context);
|
| + expect(codec.decode(id), isNull);
|
| + }
|
| + // encode again
|
| + {
|
| + AnalysisContext context = new _MockAnalysisContext('context');
|
| + // encode
|
| + int id = codec.encode(context);
|
| + expect(id, 1);
|
| + expect(codec.decode(id), context);
|
| + }
|
| + }
|
| }
|
|
|
|
|
|
|