Chromium Code Reviews| Index: pkg/analyzer/test/src/summary/resynthesize_test.dart |
| diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart |
| index 3038400625543de1ff034047aa17cb06654c76c9..ead5ed11e8d5d3c33579abbd8f53ede547c17009 100644 |
| --- a/pkg/analyzer/test/src/summary/resynthesize_test.dart |
| +++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart |
| @@ -222,9 +222,21 @@ class ResynthTest extends ResolverTestCase { |
| expect(resynthesized.toDoubleValue(), original.toDoubleValue(), |
| reason: desc); |
| } else if (original.toListValue() != null) { |
| - fail('Not implemented'); |
| + List<DartObject> resynthesizedList = resynthesized.toListValue(); |
| + List<DartObject> originalList = original.toListValue(); |
| + expect(resynthesizedList, hasLength(originalList.length)); |
| + for (int i = 0; i < originalList.length; i++) { |
| + compareConstantValues(resynthesizedList[i], originalList[i], desc); |
| + } |
| } else if (original.toMapValue() != null) { |
| - fail('Not implemented'); |
| + Map<DartObject, DartObject> resynthesizedMap = |
| + resynthesized.toMapValue(); |
| + Map<DartObject, DartObject> originalMap = original.toMapValue(); |
| + expect(resynthesizedMap, hasLength(originalMap.length)); |
| + originalMap.forEach((originalKey, originalValue) { |
|
Paul Berry
2016/01/28 23:43:07
In Dart, maps are ordered, so there are subtle sem
scheglov
2016/01/29 17:07:08
Thanks, I will add better validation.
It turned ou
|
| + DartObject resynthesizedValue = resynthesizedMap[originalKey]; |
| + compareConstantValues(resynthesizedValue, originalValue, desc); |
| + }); |
| } else if (original.toStringValue() != null) { |
| expect(resynthesized.toStringValue(), original.toStringValue(), |
| reason: desc); |
| @@ -1017,6 +1029,20 @@ const vComplement = ~1; |
| '''); |
| } |
| + test_const_topLevel_untypedList() { |
| + shouldCompareConstValues = true; |
| + checkLibrary(r''' |
| +const v = const [1, 2, 3]; |
| +'''); |
| + } |
| + |
| + test_const_topLevel_untypedMap() { |
| + shouldCompareConstValues = true; |
| + checkLibrary(r''' |
| +const v = const {0: 'aaa', 1: 'bbb', 2: 'ccc'}; |
| +'''); |
| + } |
| + |
| test_constructor_documented() { |
| checkLibrary(''' |
| class C { |