Skip to content

Commit

Permalink
Improve coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
weichsel committed Jun 9, 2024
1 parent ee780a5 commit e01c8dd
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Tests/ZIPFoundationTests/ZIPFoundationMemoryTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ extension ZIPFoundationTests {
try archive.replaceCurrentArchive(with: replacementArchive),
throws: Archive.ArchiveError.unwritableArchive
)

var noEndOfCentralDirectoryArchiveURL = ZIPFoundationTests.tempZipDirectoryURL
noEndOfCentralDirectoryArchiveURL.appendPathComponent(ProcessInfo.processInfo.globallyUniqueString)
let fullPermissionAttributes = [FileAttributeKey.posixPermissions: NSNumber(value: defaultFilePermissions)]
FileManager().createFile(atPath: noEndOfCentralDirectoryArchiveURL.path, contents: nil,
attributes: fullPermissionAttributes)
let noEOCDArchiveData = try Data(contentsOf: noEndOfCentralDirectoryArchiveURL)
XCTAssertSwiftError(try Archive(data: noEOCDArchiveData, accessMode: .update),
throws: Archive.ArchiveError.missingEndOfCentralDirectoryRecord)
}

func testReadOnlyFile() {
Expand Down

0 comments on commit e01c8dd

Please sign in to comment.