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

Unified Diff: pkg/analyzer/test/file_system/physical_resource_provider_test.dart

Issue 2490023003: Add File.lengthSync to use it for FileByteStore eviction. (Closed)
Patch Set: Created 4 years, 1 month 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/test/file_system/memory_file_system_test.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/file_system/physical_resource_provider_test.dart
diff --git a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
index 39ac5dcfa4d41091f729dff256fc42aa28e82ac6..62b4bbafd0de1bae1d3ed5a3d13d883c8124e6a5 100644
--- a/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
+++ b/pkg/analyzer/test/file_system/physical_resource_provider_test.dart
@@ -97,6 +97,19 @@ class FileTest extends _BaseTest {
expect(file.isOrContains('foo'), isFalse);
}
+ void test_lengthSync_doesNotExist() {
+ File file = PhysicalResourceProvider.INSTANCE.getResource(path);
+ expect(() {
+ file.lengthSync;
+ }, throwsA(_isFileSystemException));
+ }
+
+ void test_lengthSync_exists() {
+ List<int> bytes = <int>[1, 2, 3, 4, 5];
+ new io.File(path).writeAsBytesSync(bytes);
+ expect(file.lengthSync, bytes.length);
+ }
+
void test_modificationStamp_doesNotExist() {
File file = PhysicalResourceProvider.INSTANCE.getResource(path);
expect(() {
« no previous file with comments | « pkg/analyzer/test/file_system/memory_file_system_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698