Migrate file_store to null safety (#79111)

This commit is contained in:
Jenn Magder
2021-03-29 20:44:05 -07:00
committed by GitHub
parent 6dcaeb3d90
commit 4a2ff6490f
2 changed files with 36 additions and 20 deletions

View File

@@ -103,6 +103,19 @@ void main() {
expect(fileStorage.files.single.path, file.path);
});
testWithoutContext('FileStore handles changed format', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final File cacheFile = fileSystem.file(FileStore.kFileCache)..writeAsStringSync(
'{"version":1,"files":[{"path_old":"foo.dart","hash_old":"f95b70fdc3088560732a5ac135644506"}]}');
final FileStore fileCache = FileStore(
cacheFile: cacheFile,
logger: BufferLogger.test(),
);
fileCache.initialize();
expect(cacheFile, isNot(exists));
});
testWithoutContext('FileStore handles persisting with a missing build directory', () async {
final FileSystem fileSystem = MemoryFileSystem.test();
final File cacheFile = fileSystem