@@ -105,44 +105,44 @@ final class ZipArchiverTests: XCTestCase {
105105 #endif
106106
107107 try await testWithTemporaryDirectory { tmpdir in
108- let archiver = ZipArchiver ( fileSystem: localFileSystem)
108+ let archiver = ZipArchiver ( fileSystem: localFileSystem)
109109
110- let rootDir = tmpdir. appending ( component: UUID ( ) . uuidString)
111- try localFileSystem. createDirectory ( rootDir)
112- try localFileSystem. writeFileContents ( rootDir. appending ( " file1.txt " ) , string: " Hello World! " )
110+ let rootDir = tmpdir. appending ( component: UUID ( ) . uuidString)
111+ try localFileSystem. createDirectory ( rootDir)
112+ try localFileSystem. writeFileContents ( rootDir. appending ( " file1.txt " ) , string: " Hello World! " )
113113
114- let dir1 = rootDir. appending ( " dir1 " )
115- try localFileSystem. createDirectory ( dir1)
116- try localFileSystem. writeFileContents ( dir1. appending ( " file2.txt " ) , string: " Hello World 2! " )
114+ let dir1 = rootDir. appending ( " dir1 " )
115+ try localFileSystem. createDirectory ( dir1)
116+ try localFileSystem. writeFileContents ( dir1. appending ( " file2.txt " ) , string: " Hello World 2! " )
117117
118118 let dir2 = dir1. appending ( " dir2 " )
119119 try localFileSystem. createDirectory ( dir2)
120120 try localFileSystem. writeFileContents ( dir2. appending ( " file3.txt " ) , string: " Hello World 3! " )
121121 try localFileSystem. writeFileContents ( dir2. appending ( " file4.txt " ) , string: " Hello World 4! " )
122122 try localFileSystem. createSymbolicLink ( dir2. appending ( " file5.txt " ) , pointingAt: dir1. appending ( " file2.txt " ) , relative: true )
123123
124- let archivePath = tmpdir. appending ( component: UUID ( ) . uuidString + " .zip " )
125- try await archiver. compress ( directory: rootDir, to: archivePath)
126- XCTAssertFileExists ( archivePath)
127-
128- let extractRootDir = tmpdir. appending ( component: UUID ( ) . uuidString)
129- try localFileSystem. createDirectory ( extractRootDir)
130- try await archiver. extract ( from: archivePath, to: extractRootDir)
131- try localFileSystem. stripFirstLevel ( of: extractRootDir)
132-
133- XCTAssertFileExists ( extractRootDir. appending ( " file1.txt " ) )
134- XCTAssertEqual (
135- try ? localFileSystem. readFileContents ( extractRootDir. appending ( " file1.txt " ) ) ,
136- " Hello World! "
137- )
138-
139- let extractedDir1 = extractRootDir. appending ( " dir1 " )
140- XCTAssertDirectoryExists ( extractedDir1)
141- XCTAssertFileExists ( extractedDir1. appending ( " file2.txt " ) )
142- XCTAssertEqual (
143- try ? localFileSystem. readFileContents ( extractedDir1. appending ( " file2.txt " ) ) ,
144- " Hello World 2! "
145- )
124+ let archivePath = tmpdir. appending ( component: UUID ( ) . uuidString + " .zip " )
125+ try await archiver. compress ( directory: rootDir, to: archivePath)
126+ XCTAssertFileExists ( archivePath)
127+
128+ let extractRootDir = tmpdir. appending ( component: UUID ( ) . uuidString)
129+ try localFileSystem. createDirectory ( extractRootDir)
130+ try await archiver. extract ( from: archivePath, to: extractRootDir)
131+ try localFileSystem. stripFirstLevel ( of: extractRootDir)
132+
133+ XCTAssertFileExists ( extractRootDir. appending ( " file1.txt " ) )
134+ XCTAssertEqual (
135+ try ? localFileSystem. readFileContents ( extractRootDir. appending ( " file1.txt " ) ) ,
136+ " Hello World! "
137+ )
138+
139+ let extractedDir1 = extractRootDir. appending ( " dir1 " )
140+ XCTAssertDirectoryExists ( extractedDir1)
141+ XCTAssertFileExists ( extractedDir1. appending ( " file2.txt " ) )
142+ XCTAssertEqual (
143+ try ? localFileSystem. readFileContents ( extractedDir1. appending ( " file2.txt " ) ) ,
144+ " Hello World 2! "
145+ )
146146
147147 let extractedDir2 = extractedDir1. appending ( " dir2 " )
148148 XCTAssertDirectoryExists ( extractedDir2)
0 commit comments