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:
committed by
GitHub
parent
4bd848fd33
commit
bfdc9a6cfa
@@ -280,8 +280,9 @@ class ErrorHandlingFile
|
||||
);
|
||||
}
|
||||
|
||||
// TODO(aam): Pass `exclusive` through after dartbug.com/49647 lands.
|
||||
@override
|
||||
void createSync({bool recursive = false}) {
|
||||
void createSync({bool recursive = false, bool exclusive = false}) {
|
||||
_runSync<void>(
|
||||
() => delegate.createSync(
|
||||
recursive: recursive,
|
||||
|
||||
@@ -15,7 +15,7 @@ dependencies:
|
||||
completion: 1.0.0
|
||||
coverage: 1.5.0
|
||||
crypto: 3.0.2
|
||||
file: 6.1.2
|
||||
file: 6.1.3
|
||||
flutter_template_images: 4.2.0
|
||||
html: 0.15.0
|
||||
http: 0.13.5
|
||||
@@ -103,4 +103,4 @@ dartdoc:
|
||||
# Exclude this package from the hosted API docs.
|
||||
nodoc: true
|
||||
|
||||
# PUBSPEC CHECKSUM: 3d75
|
||||
# PUBSPEC CHECKSUM: 5a76
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user