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 {
103103 self . init ( . noEntry, path)
104104 case TSCLibc . ENOTDIR:
105105 self . init ( . notDirectory, path)
106+ case TSCLibc . EEXIST:
107+ self . init ( . alreadyExistsAtDestination, path)
106108 default :
107109 self . init ( . ioError( code: errno) , path)
108110 }
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