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 @@ -104,6 +104,8 @@ public extension FileSystemError {
104104 self . init ( . noEntry, path)
105105 case TSCLibc . ENOTDIR:
106106 self . init ( . notDirectory, path)
107+ case TSCLibc . EEXIST:
108+ self . init ( . alreadyExistsAtDestination, path)
107109 default :
108110 self . init ( . ioError( code: errno) , path)
109111 }
Original file line number Diff line number Diff line change @@ -331,7 +331,13 @@ class FileSystemTests: XCTestCase {
331331 _ = try fs. readFileContents ( root)
332332
333333 }
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) {
335341 try fs. writeFileContents ( root, bytes: [ ] )
336342 }
337343 XCTAssert ( fs. exists ( filePath) )
You can’t perform that action at this time.
0 commit comments