@@ -45,6 +45,8 @@ final class ZipTests: XCTestCase {
45
45
try ? FileManager . default. removeItem ( at: destinationURL)
46
46
}
47
47
XCTAssertTrue ( FileManager . default. fileExists ( atPath: destinationURL. path) )
48
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationURL. appendingPathComponent ( " 3crBXeO.gif " ) ) . count, 0 )
49
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationURL. appendingPathComponent ( " kYkLkPf.gif " ) ) . count, 0 )
48
50
}
49
51
50
52
func testQuickUnzipNonExistingPath( ) {
@@ -59,12 +61,15 @@ final class ZipTests: XCTestCase {
59
61
60
62
func testQuickUnzipProgress( ) throws {
61
63
let filePath = url ( forResource: " bb8 " , withExtension: " zip " ) !
62
- let destinationURL = try Zip . quickUnzipFile ( filePath, progress : { progress in
64
+ let destinationURL = try Zip . quickUnzipFile ( filePath) { progress in
63
65
XCTAssertFalse ( progress. isNaN)
64
- } )
66
+ }
65
67
addTeardownBlock {
66
68
try ? FileManager . default. removeItem ( at: destinationURL)
67
69
}
70
+ XCTAssertTrue ( FileManager . default. fileExists ( atPath: destinationURL. path) )
71
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationURL. appendingPathComponent ( " 3crBXeO.gif " ) ) . count, 0 )
72
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationURL. appendingPathComponent ( " kYkLkPf.gif " ) ) . count, 0 )
68
73
}
69
74
70
75
func testQuickUnzipOnlineURL( ) {
@@ -79,6 +84,8 @@ final class ZipTests: XCTestCase {
79
84
XCTAssertNoThrow ( try Zip . unzipFile ( filePath, destination: destinationPath, overwrite: true , password: " password " , progress: nil ) )
80
85
81
86
XCTAssertTrue ( FileManager . default. fileExists ( atPath: destinationPath. path) )
87
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationPath. appendingPathComponent ( " 3crBXeO.gif " ) ) . count, 0 )
88
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationPath. appendingPathComponent ( " kYkLkPf.gif " ) ) . count, 0 )
82
89
}
83
90
84
91
func testImplicitProgressUnzip( ) throws {
@@ -113,7 +120,8 @@ final class ZipTests: XCTestCase {
113
120
let imageURL1 = url ( forResource: " 3crBXeO " , withExtension: " gif " ) !
114
121
let imageURL2 = url ( forResource: " kYkLkPf " , withExtension: " gif " ) !
115
122
let destinationURL = try Zip . quickZipFiles ( [ imageURL1, imageURL2] , fileName: " archive " )
116
- XCTAssertTrue ( FileManager . default. fileExists ( atPath: destinationURL. path) )
123
+ XCTAssertTrue ( FileManager . default. fileExists ( atPath: destinationURL. path) )
124
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationURL) . count, 0 )
117
125
addTeardownBlock {
118
126
try ? FileManager . default. removeItem ( at: destinationURL)
119
127
}
@@ -126,6 +134,7 @@ final class ZipTests: XCTestCase {
126
134
XCTAssertFalse ( progress. isNaN)
127
135
}
128
136
XCTAssertTrue ( FileManager . default. fileExists ( atPath: destinationURL. path) )
137
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationURL) . count, 0 )
129
138
addTeardownBlock {
130
139
try ? FileManager . default. removeItem ( at: destinationURL)
131
140
}
@@ -337,6 +346,7 @@ final class ZipTests: XCTestCase {
337
346
XCTAssert ( FileManager . default. fileExists ( atPath: destinationFolder. appendingPathComponent ( " metadata.json " ) . path) )
338
347
XCTAssert ( FileManager . default. fileExists ( atPath: destinationFolder. appendingPathComponent ( " main/index.html " ) . path) )
339
348
XCTAssert ( FileManager . default. fileExists ( atPath: destinationFolder. appendingPathComponent ( " main/index/index.json " ) . path) )
349
+ try XCTAssertGreaterThan ( Data ( contentsOf: destinationFolder. appendingPathComponent ( " metadata.json " ) ) . count, 0 )
340
350
341
351
let unzippedFiles = try FileManager . default. contentsOfDirectory ( atPath: destinationFolder. path)
342
352
@@ -350,6 +360,7 @@ final class ZipTests: XCTestCase {
350
360
XCTAssert ( FileManager . default. fileExists ( atPath: newDestinationFolder. appendingPathComponent ( " metadata.json " ) . path) )
351
361
XCTAssert ( FileManager . default. fileExists ( atPath: newDestinationFolder. appendingPathComponent ( " main/index.html " ) . path) )
352
362
XCTAssert ( FileManager . default. fileExists ( atPath: newDestinationFolder. appendingPathComponent ( " main/index/index.json " ) . path) )
363
+ try XCTAssertGreaterThan ( Data ( contentsOf: newDestinationFolder. appendingPathComponent ( " metadata.json " ) ) . count, 0 )
353
364
354
365
let newUnzippedFiles = try FileManager . default. contentsOfDirectory ( atPath: newDestinationFolder. path)
355
366
XCTAssertEqual ( unzippedFiles, newUnzippedFiles)
0 commit comments