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

Unified Diff: pkg/front_end/test/incremental_kernel_generator_test.dart

Issue 2885883002: Fix computing export scopes for library cycles and after loading. (Closed)
Patch Set: Created 3 years, 7 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/front_end/lib/src/incremental_kernel_generator_impl.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/test/incremental_kernel_generator_test.dart
diff --git a/pkg/front_end/test/incremental_kernel_generator_test.dart b/pkg/front_end/test/incremental_kernel_generator_test.dart
index 804f216d9a595e4fb174de152218b540ed6eb964..8c963340b59a713fe31b40a89d979fef2fcb072b 100644
--- a/pkg/front_end/test/incremental_kernel_generator_test.dart
+++ b/pkg/front_end/test/incremental_kernel_generator_test.dart
@@ -145,6 +145,69 @@ static field a::A a;
''');
}
+ test_compile_export_cycle() async {
+ writeFile('/test/.packages', 'test:lib/');
+ String aPath = '/test/lib/a.dart';
+ String bPath = '/test/lib/b.dart';
+ String cPath = '/test/lib/c.dart';
+ writeFile(aPath, 'export "b.dart"; class A {}');
+ writeFile(bPath, 'export "a.dart"; class B {}');
+ Uri cUri = writeFile(
+ cPath,
+ r'''
+import 'b.dart';
+A a;
+B b;
+''');
+
+ {
+ Program program = await getInitialState(cUri);
+ Library library = _getLibrary(program, cUri);
+ expect(
+ _getLibraryText(library),
+ r'''
+library;
+import self as self;
+import "./a.dart" as a;
+import "./b.dart" as b;
+
+static field a::A a;
+static field b::B b;
+''');
+ }
+
+ // Update c.dart and compile.
+ // We should load the cycle [a.dart, b.dart] from the byte store.
+ // This tests that we compute export scopes after loading.
+ writeFile(
+ cPath,
+ r'''
+import 'b.dart';
+A a;
+B b;
+int c;
+''');
+ incrementalKernelGenerator.invalidate(cUri);
+ {
+ DeltaProgram delta = await incrementalKernelGenerator.computeDelta();
+ Program program = delta.newProgram;
+ Library library = _getLibrary(program, cUri);
+ expect(
+ _getLibraryText(library),
+ r'''
+library;
+import self as self;
+import "./a.dart" as a;
+import "./b.dart" as b;
+import "dart:core" as core;
+
+static field a::A a;
+static field b::B b;
+static field core::int c;
+''');
+ }
+ }
+
test_compile_typedef() async {
writeFile('/test/.packages', 'test:lib/');
String aPath = '/test/lib/a.dart';
« no previous file with comments | « pkg/front_end/lib/src/incremental_kernel_generator_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698