Introduce stubbed exclusive parameter to File.create-overridden method (#109646)

* Introduce stubbed `exclusive` parameter to `File.create`-overridden method.

This is to soften landing of a breaking change https://github.com/dart-lang/sdk/issues/49647
This commit is contained in:
Alexander Aprelev
2022-08-17 13:26:08 -07:00
committed by GitHub
parent 4bd848fd33
commit bfdc9a6cfa
46 changed files with 95 additions and 89 deletions

View File

@@ -48,6 +48,11 @@ void main() {
expect(ErrorHandlingFileSystem.deleteIfExists(file), true);
});
testWithoutContext('create accepts exclusive argument', () {
final FileSystem fileSystem = MemoryFileSystem.test();
expect(fileSystem.file('file').create(exclusive: true), isNotNull);
});
testWithoutContext('deleteIfExists handles separate program deleting file', () {
final File file = FakeExistsFile()
..error = const FileSystemException('', '', OSError('', 2));