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

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

Issue 1670403002: Resynthesize top-level function references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 b229219a22be7336c5b7931884c448e3c84f8cfe..1348b8e70a5a92808139e5e34ec5cbc2606b0a82 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -1413,6 +1413,40 @@ const V = p.C.m;
''');
}
+ test_const_reference_topLevelFunction() {
+ shouldCompareConstValues = true;
+ checkLibrary(r'''
+foo() {}
+const V = foo;
+''');
+ }
+
+ test_const_reference_topLevelFunction_imported() {
+ shouldCompareConstValues = true;
+ addLibrarySource(
+ '/a.dart',
+ r'''
+foo() {}
+''');
+ checkLibrary(r'''
+import 'a.dart';
+const V = foo;
+''');
+ }
+
+ test_const_reference_topLevelFunction_imported_withPrefix() {
+ shouldCompareConstValues = true;
+ addLibrarySource(
+ '/a.dart',
+ r'''
+foo() {}
+''');
+ checkLibrary(r'''
+import 'a.dart' as p;
+const V = p.foo;
+''');
+ }
+
test_const_reference_topLevelVariable() {
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