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

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

Issue 2928483005: Add an incremental reloader example and a utility tool to trigger a reload by (Closed)
Patch Set: CL comments Created 3 years, 6 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') | pkg/front_end/tool/vm/reload.dart » ('j') | 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 044a52e99f6ca7832649642ab4a231dd9bd58d76..6bac963bb5c695213e299f8635216a3f668b84b9 100644
--- a/pkg/front_end/test/incremental_kernel_generator_test.dart
+++ b/pkg/front_end/test/incremental_kernel_generator_test.dart
@@ -663,6 +663,26 @@ static method main() → void {}
}
}
+ test_invalidateAll() async {
+ writeFile('/test/.packages', '');
+ Uri aUri = writeFile('/test/a.dart', "import 'b.dart';\nint a = b;");
+ Uri bUri = writeFile('/test/b.dart', 'var b = 1;');
+
+ Program program = await getInitialState(aUri);
+ expect(_getLibraryText(_getLibrary(program, aUri)), contains("int a ="));
Siggi Cherem (dart-lang) 2017/06/07 20:17:11 Let me know if you prefer that I check the full te
scheglov 2017/06/07 20:26:32 Verifying only relevant parts is perfectly fine.
Siggi Cherem (dart-lang) 2017/06/07 20:51:09 I have highlighting too :) - the problem is that I
+ expect(_getLibraryText(_getLibrary(program, bUri)), contains("b = 1"));
+
+ writeFile('/test/a.dart', "import 'b.dart';\ndouble a = b;");
+ writeFile('/test/b.dart', 'var b = 2;');
+ incrementalKernelGenerator.invalidateAll();
+
+ DeltaProgram delta = await incrementalKernelGenerator.computeDelta();
+ program = delta.newProgram;
+ _assertLibraryUris(program, includes: [aUri, bUri]);
+ expect(_getLibraryText(_getLibrary(program, aUri)), contains("double a ="));
+ expect(_getLibraryText(_getLibrary(program, bUri)), contains("b = 2"));
+ }
+
/// Write the given [text] of the file with the given [path] into the
/// virtual filesystem. Return the URI of the file.
Uri writeFile(String path, String text) {
« no previous file with comments | « pkg/front_end/lib/src/incremental_kernel_generator_impl.dart ('k') | pkg/front_end/tool/vm/reload.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698