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

Unified Diff: pkg/analyzer/test/file_system/memory_file_system_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
Index: pkg/analyzer/test/file_system/memory_file_system_test.dart
diff --git a/pkg/analyzer/test/file_system/memory_file_system_test.dart b/pkg/analyzer/test/file_system/memory_file_system_test.dart
index abc373f6d2237d8e98902af3e2e894b59214acca..cb39b49924d876915435b1e9d97d14f859bf43e5 100644
--- a/pkg/analyzer/test/file_system/memory_file_system_test.dart
+++ b/pkg/analyzer/test/file_system/memory_file_system_test.dart
@@ -111,6 +111,20 @@ class FileTest {
expect(file.isOrContains(provider.convertPath('/foo/bar')), isFalse);
}
+ void test_lengthSync_doesNotExist() {
+ File file = provider.getResource(provider.convertPath('/test.txt'));
+ expect(() {
+ file.lengthSync;
+ }, throwsA(_isFileSystemException));
+ }
+
+ void test_lengthSync_exists() {
+ List<int> bytes = <int>[1, 2, 3, 4, 5];
+ File file =
+ provider.newFileWithBytes(provider.convertPath('/file.bin'), bytes);
+ expect(file.lengthSync, bytes.length);
+ }
+
void test_modificationStamp_doesNotExist() {
String path = provider.convertPath('/foo/bar/file.txt');
File file = provider.newFile(path, 'qwerty');

Powered by Google App Engine
This is Rietveld 408576698