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

Unified Diff: pkg/analysis_server/test/services/index/store/codec_test.dart

Issue 736603005: Rollback r41807. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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
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));
}
}

Powered by Google App Engine
This is Rietveld 408576698