Skip to content

Commit b7b73d9

Browse files
committed
Unzip test added to unarchive a non zip file.
1 parent 95d23c5 commit b7b73d9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

UnitTests/CCPackageUnzipperTests.m

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,18 @@ - (void)testUnzippingOfInaccessibleUnzipFolder
115115
}
116116
*/
117117

118+
- (void)testUnzipTrash
119+
{
120+
NSString *pathToZip = [NSTemporaryDirectory() stringByAppendingPathComponent:@"trash.zip"];
121+
122+
[@"asdiuhaiudhweudiuwefi" writeToFile:pathToZip atomically:YES encoding:NSUTF8StringEncoding error:nil];
123+
124+
_package.localDownloadURL = [NSURL fileURLWithPath:pathToZip];
125+
126+
[self unzipUntilDelegateMethodsReturn:nil];
127+
XCTAssertFalse(_unzippingSuccessful);
128+
}
129+
118130
- (void)testUnzipOfPasswordProtectedPackage
119131
{
120132
NSString *pathToZip = [[NSBundle mainBundle] pathForResource:@"Resources-shared/Packages/password-iOS-phone" ofType:@"zip"];

0 commit comments

Comments
 (0)