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

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

Issue 1561073007: Set LibraryElement.entryPoint properly during summary resynthesis. (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
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 26d94631bc2a1bd86fad63003346c50fcc2da842..9815eff3862765690c4a78f595f75bde190f13ca 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -64,7 +64,14 @@ class ResynthTest extends ResolverTestCase {
'export ${original.exports[i].uri}');
}
expect(resynthesized.nameLength, original.nameLength);
- // TODO(paulberry): test entryPoint, exportNamespace, publicNamespace,
+ if (original.entryPoint == null) {
+ expect(resynthesized.entryPoint, isNull);
+ } else {
+ expect(resynthesized.entryPoint, isNotNull);
+ compareFunctionElements(
+ resynthesized.entryPoint, original.entryPoint, '(entry point)');
+ }
+ // TODO(paulberry): test exportNamespace, publicNamespace,
// and metadata.
}
@@ -799,6 +806,15 @@ class E {
checkLibrary('export "a.dart"; export "b.dart";');
}
+ test_function_entry_point() {
+ checkLibrary('main() {}');
+ }
+
+ test_function_entry_point_in_part() {
+ addNamedSource('/a.dart', 'part of my.lib; main() {}');
+ checkLibrary('library my.lib; part "a.dart";');
+ }
+
test_function_external() {
checkLibrary('external f();');
}

Powered by Google App Engine
This is Rietveld 408576698