File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,7 +53,20 @@ struct Test_FITSFile
5353
5454 #expect( throws: FITSError . self ) { try FITSFile ( url: url ) }
5555
56- try ? FileManager . default. removeItem ( at: url )
56+ try FileManager . default. removeItem ( at: url )
57+ }
58+
59+ @Test
60+ func unreadableFile( ) async throws
61+ {
62+ let url = URL ( fileURLWithPath: NSTemporaryDirectory ( ) , isDirectory: true ) . appending ( component: UUID ( ) . uuidString ) . appendingPathExtension ( " fits " )
63+
64+ try #require( FileManager . default. fileExists ( atPath: url. path ) == false )
65+ try #require( FileManager . default. createFile ( atPath: url. path, contents: Data ( ) , attributes: [ . posixPermissions: 0666 ] ) )
66+
67+ #expect( throws: FITSError . self ) { try FITSFile ( url: url ) }
68+
69+ try FileManager . default. removeItem ( at: url )
5770 }
5871
5972 @Test
You can’t perform that action at this time.
0 commit comments