Don't clean output director for debugging purposes
This commit is contained in:
+11
-26
@@ -70,31 +70,31 @@
|
||||
}
|
||||
|
||||
- (void)testUnzippingTruncatedFileFix {
|
||||
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IncorrectHeaders" ofType:@"zip"];
|
||||
NSString *outputPath = [self _cachesPath:@"IncorrectHeaders"];
|
||||
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IncorrectHeaders" ofType:@"zip"];
|
||||
NSString* outputPath = [self _cachesPath:@"IncorrectHeaders"];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
NSString *intendedReadmeTxtMD5 = @"31ac96301302eb388070c827447290b5";
|
||||
NSString* intendedReadmeTxtMD5 = @"31ac96301302eb388070c827447290b5";
|
||||
|
||||
NSString *filePath = [outputPath stringByAppendingPathComponent:@"IncorrectHeaders/Readme.txt"];
|
||||
NSData *data = [NSData dataWithContentsOfFile:filePath];
|
||||
NSString* filePath = [outputPath stringByAppendingPathComponent:@"IncorrectHeaders/Readme.txt"];
|
||||
NSData* data = [NSData dataWithContentsOfFile:filePath];
|
||||
|
||||
NSString *actualReadmeTxtMD5 = [self _calculateMD5Digest:data];
|
||||
NSString* actualReadmeTxtMD5 = [self _calculateMD5Digest:data];
|
||||
STAssertTrue([actualReadmeTxtMD5 isEqualToString:intendedReadmeTxtMD5], @"Readme.txt MD5 digest should match original.");
|
||||
}
|
||||
|
||||
- (void)testUnzippingWithSymlinkedFileInside {
|
||||
|
||||
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"SymbolicLink" ofType:@"zip"];
|
||||
NSString *outputPath = [self _cachesPath:@"SymbolicLink"];
|
||||
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"SymbolicLink" ofType:@"zip"];
|
||||
NSString* outputPath = [self _cachesPath:@"SymbolicLink"];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
NSString *testSymlink = [outputPath stringByAppendingPathComponent:@"SymbolicLink/GitHub.app"];
|
||||
NSString* testSymlink = [outputPath stringByAppendingPathComponent:@"SymbolicLink/GitHub.app"];
|
||||
|
||||
NSError *error = nil;
|
||||
NSString *symlinkPath = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath:testSymlink error:&error];
|
||||
NSError* error = nil;
|
||||
NSString* symlinkPath = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath:testSymlink error:&error];
|
||||
|
||||
bool symbolicLinkPersists = ((symlinkPath != nil) && [symlinkPath isEqualToString:@"/Applications/GitHub.app"]) && (error == nil);
|
||||
|
||||
@@ -102,21 +102,6 @@
|
||||
}
|
||||
|
||||
|
||||
- (void)testUnzippingWithUnicodeFilenameInside {
|
||||
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Unicode" ofType:@"zip"];
|
||||
NSString *outputPath = [self _cachesPath:@"Unicode"];
|
||||
|
||||
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
|
||||
|
||||
bool unicodeFilenameWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Unicode/Accént.txt"]];
|
||||
|
||||
bool unicodeFolderWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Unicode/Fólder"]];
|
||||
|
||||
STAssertTrue(unicodeFilenameWasExtracted, @"Files with filenames in unicode should be extracted properly.");
|
||||
STAssertTrue(unicodeFolderWasExtracted, @"Folders with names in unicode should be extracted propertly.");
|
||||
}
|
||||
|
||||
|
||||
// Commented out to avoid checking in several gig file into the repository. Simply add a file named
|
||||
// `LargeArchive.zip` to the project and uncomment out these lines to test.
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user