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

Unified Diff: pkg/analyzer/test/src/dart/analysis/file_state_test.dart

Issue 2987303002: Fix for truncated unlinked summaries in ByteStore. (Closed)
Patch Set: Created 3 years, 5 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/dart/analysis/file_state.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/dart/analysis/file_state_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
index f61ecaacd8b35d3ea4cfa9464d45b6b50ddfc72f..b409d92a4d8885ac65b32b5480bda61eb491727b 100644
--- a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
@@ -601,6 +601,22 @@ class C {
expect(file.apiSignature, signature);
}
+ test_store_zeroLengthUnlinked() {
+ String path = _p('/test.dart');
+ provider.newFile(path, 'class A {}');
+
+ // Get the file, prepare unlinked.
+ FileState file = fileSystemState.getFileForPath(path);
+ expect(file.unlinked, isNotNull);
+
+ // Make the unlinked unit in the byte store zero-length, damaged.
+ byteStore.put(file.test.unlinkedKey, <int>[]);
+
+ // Refresh should not fail, zero bytes in the store are ignored.
+ file.refresh();
+ expect(file.unlinked, isNotNull);
+ }
+
test_subtypedNames() {
String path = _p('/test.dart');
provider.newFile(path, r'''
« no previous file with comments | « pkg/analyzer/lib/src/dart/analysis/file_state.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698