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

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1643283002: Resynthesize typed constant lists and maps. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months 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
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1cc1cda4a7b4d7fe09c0910e01c451145cdfa698..d4bf492b16a4eadab15263f1954c218086212485 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -1025,6 +1025,46 @@ const vSymbol = #aaa.bbb.ccc;
''');
}
+ test_const_topLevel_typedList() {
+ shouldCompareConstValues = true;
+ checkLibrary(r'''
+const vNull = const <Null>[];
+const vDynamic = const <dynamic>[1, 2, 3];
+const vInterfaceNoTypeParameters = const <int>[1, 2, 3];
+const vInterfaceNoTypeArguments = const <List>[];
+const vInterfaceWithTypeArguments = const <List<String>>[];
+const vInterfaceWithTypeArguments2 = const <Map<int, List<String>>>[];
+''');
+ }
+
+ test_const_topLevel_typedList_imported() {
+ shouldCompareConstValues = true;
+ addNamedSource('/a.dart', 'class C {}');
+ checkLibrary(r'''
+import 'a.dart';
+const v = const <C>[];
+''');
+ }
+
+ test_const_topLevel_typedList_importedWithPrefix() {
+ shouldCompareConstValues = true;
+ addNamedSource('/a.dart', 'class C {}');
+ checkLibrary(r'''
+import 'a.dart' as p;
+const v = const <p.C>[];
+''');
+ }
+
+ test_const_topLevel_typedMap() {
+ shouldCompareConstValues = true;
+ checkLibrary(r'''
+const vDynamic1 = const <dynamic, int>{};
+const vDynamic2 = const <int, dynamic>{};
+const vInterface = const <int, String>{};
+const vInterfaceWithTypeArguments = const <int, List<String>>{};
+''');
+ }
+
test_const_topLevel_unary() {
shouldCompareConstValues = true;
checkLibrary(r'''
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698