File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,8 @@ public extension FileSystemError {
103
103
self . init ( . noEntry, path)
104
104
case TSCLibc . ENOTDIR:
105
105
self . init ( . notDirectory, path)
106
+ case TSCLibc . EEXIST:
107
+ self . init ( . alreadyExistsAtDestination, path)
106
108
default :
107
109
self . init ( . ioError( code: errno) , path)
108
110
}
Original file line number Diff line number Diff line change @@ -331,7 +331,13 @@ class FileSystemTests: XCTestCase {
331
331
_ = try fs. readFileContents ( root)
332
332
333
333
}
334
- XCTAssertThrows ( FileSystemError ( . isDirectory, root) ) {
334
+ #if os(macOS)
335
+ // Newer versions of macOS end up with `EEXISTS` instead of `EISDIR` here.
336
+ let expectedError = FileSystemError ( . alreadyExistsAtDestination, root)
337
+ #else
338
+ let expectedError = FileSystemError ( . isDirectory, root)
339
+ #endif
340
+ XCTAssertThrows ( expectedError) {
335
341
try fs. writeFileContents ( root, bytes: [ ] )
336
342
}
337
343
XCTAssert ( fs. exists ( filePath) )
You can’t perform that action at this time.
0 commit comments