Skip to content

Commit

Permalink
Fix tests on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Oct 2, 2024
1 parent 9a38aba commit 668236f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion Sources/Zip/Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ public class Zip {
throw ZipError.unzipFail
}
guard writeBytes == fileInfo.uncompressed_size else {
print("XXXXXXXXXXX - 8")
throw ZipError.unzipFail
}

Expand Down
7 changes: 3 additions & 4 deletions Tests/ZipTests/ZipTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,10 @@ final class ZipTests: XCTestCase {
try XCTAssertGreaterThan(Data(contentsOf: destinationPath.appendingPathComponent("kYkLkPf.gif")).count, 0)
}

// This Zip file contains reserved characters that are not allowed on Windows.
#if !os(Windows)
// Tests if https://github.com/vapor-community/Zip/issues/4 does not occur anymore.
func testRoundTripping() throws {
#if os(Windows)
XCTSkip("This Zip file contains reserved characters that are not allowed on Windows.")
#endif

// "prod-apple-swift-metrics-main-e6a00d36.zip" is the original zip file from the issue.
let zipFilePath = url(forResource: "prod-apple-swift-metrics-main-e6a00d36", withExtension: "zip")!
let failDestinationPath = try autoRemovingSandbox()
Expand Down Expand Up @@ -405,4 +403,5 @@ final class ZipTests: XCTestCase {
let newUnzippedFiles = try FileManager.default.contentsOfDirectory(atPath: newDestinationFolder.path)
XCTAssertEqual(unzippedFiles, newUnzippedFiles)
}
#endif
}

0 comments on commit 668236f

Please sign in to comment.