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

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

Issue 2907673002: Files are added with absolute URIs, but invalidated with file URIs. (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 5833ede1e8e98c09ab3adffe2a62dd41c6a55d0d..16a21b382ba46ce91cf04b6d69e55e9b9363b2fc 100644
--- a/pkg/front_end/test/incremental_kernel_generator_test.dart
+++ b/pkg/front_end/test/incremental_kernel_generator_test.dart
@@ -482,6 +482,55 @@ static method main() → dynamic {
}
}
+ test_updatePackageSourceUsingFileUri() async {
+ writeFile('/test/.packages', 'test:lib/');
+ Uri aFileUri = writeFile(
+ '/test/bin/a.dart',
+ r'''
+import 'package:test/b.dart';
+var a = b;
+''');
+ Uri bFileUri = writeFile('/test/lib/b.dart', 'var b = 1;');
+ Uri bPackageUri = Uri.parse('package:test/b.dart');
+
+ // Compute the initial state.
+ {
+ Program program = await getInitialState(aFileUri);
+ Library library = _getLibrary(program, aFileUri);
+ expect(
+ _getLibraryText(library),
+ r'''
+library;
+import self as self;
+import "dart:core" as core;
+import "package:test/b.dart" as b;
+
+static field core::int a = b::b;
+''');
+ }
+
+ // Update b.dart and use file URI to invalidate it.
+ // The delta is recomputed even though b.dart is used with the package URI.
+ writeFile('/test/lib/b.dart', 'var b = 1.2;');
+ incrementalKernelGenerator.invalidate(bFileUri);
+ {
+ DeltaProgram delta = await incrementalKernelGenerator.computeDelta();
+ Program program = delta.newProgram;
+ _assertLibraryUris(program, includes: [aFileUri, bPackageUri]);
+ Library library = _getLibrary(program, aFileUri);
+ expect(
+ _getLibraryText(library),
+ r'''
+library;
+import self as self;
+import "dart:core" as core;
+import "package:test/b.dart" as b;
+
+static field core::double a = b::b;
+''');
+ }
+ }
+
test_updatePart() async {
writeFile('/test/.packages', 'test:lib/');
String libPath = '/test/lib/test.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