@@ -22,29 +22,29 @@ final class ZipTests: XCTestCase {
22
22
func test_zip( ) async throws {
23
23
// Test basic zip behaviour we expect from the library we use
24
24
try await withTempDir { tempDir in
25
- let tempURL = URL ( filePath : tempDir)
26
- let fileA = tempURL. appending ( path : " a.txt " )
27
- let fileB = tempURL. appending ( path : " b.txt " )
25
+ let tempURL = URL ( fileURLWithPath : tempDir)
26
+ let fileA = tempURL. appendingPathComponent ( " a.txt " )
27
+ let fileB = tempURL. appendingPathComponent ( " b.txt " )
28
28
try " a " . write ( to: fileA, atomically: true , encoding: . utf8)
29
29
try " b " . write ( to: fileB, atomically: true , encoding: . utf8)
30
- let zipFile = tempURL. appending ( path : " out.zip " )
30
+ let zipFile = tempURL. appendingPathComponent ( " out.zip " )
31
31
try Zipping . zip ( paths: [ fileA, fileB] , to: zipFile)
32
- XCTAssert ( FileManager . default. fileExists ( atPath: zipFile. path ( ) ) )
32
+ XCTAssert ( FileManager . default. fileExists ( atPath: zipFile. path) )
33
33
}
34
34
}
35
35
36
36
func test_unzip( ) async throws {
37
37
// Test basic unzip behaviour we expect from the library we use
38
38
try await withTempDir { tempDir in
39
- let tempURL = URL ( filePath : tempDir)
39
+ let tempURL = URL ( fileURLWithPath : tempDir)
40
40
let zipFile = fixtureUrl ( for: " out.zip " )
41
- let outDir = tempURL. appending ( path : " out " )
41
+ let outDir = tempURL. appendingPathComponent ( " out " )
42
42
try Zipping . unzip ( from: zipFile, to: outDir)
43
- XCTAssert ( FileManager . default. fileExists ( atPath: outDir. path ( ) ) )
44
- let fileA = outDir. appending ( path : " a.txt " )
45
- let fileB = outDir. appending ( path : " b.txt " )
46
- XCTAssert ( FileManager . default. fileExists ( atPath: fileA. path ( ) ) )
47
- XCTAssert ( FileManager . default. fileExists ( atPath: fileB. path ( ) ) )
43
+ XCTAssert ( FileManager . default. fileExists ( atPath: outDir. path) )
44
+ let fileA = outDir. appendingPathComponent ( " a.txt " )
45
+ let fileB = outDir. appendingPathComponent ( " b.txt " )
46
+ XCTAssert ( FileManager . default. fileExists ( atPath: fileA. path) )
47
+ XCTAssert ( FileManager . default. fileExists ( atPath: fileB. path) )
48
48
XCTAssertEqual ( try String ( contentsOf: fileA) , " a " )
49
49
XCTAssertEqual ( try String ( contentsOf: fileB) , " b " )
50
50
}
0 commit comments