Skip to content

Commit 581adbb

Browse files
committed
Don't clean output director for debugging purposes
1 parent d646bf9 commit 581adbb

File tree

1 file changed

+11
-26
lines changed

1 file changed

+11
-26
lines changed

Tests/SSZipArchiveTests.m

+11-26
Original file line numberDiff line numberDiff line change
@@ -70,53 +70,38 @@ - (void)testUnzippingWithPassword {
7070
}
7171

7272
- (void)testUnzippingTruncatedFileFix {
73-
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IncorrectHeaders" ofType:@"zip"];
74-
NSString *outputPath = [self _cachesPath:@"IncorrectHeaders"];
73+
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"IncorrectHeaders" ofType:@"zip"];
74+
NSString* outputPath = [self _cachesPath:@"IncorrectHeaders"];
7575

7676
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
7777

78-
NSString *intendedReadmeTxtMD5 = @"31ac96301302eb388070c827447290b5";
78+
NSString* intendedReadmeTxtMD5 = @"31ac96301302eb388070c827447290b5";
7979

80-
NSString *filePath = [outputPath stringByAppendingPathComponent:@"IncorrectHeaders/Readme.txt"];
81-
NSData *data = [NSData dataWithContentsOfFile:filePath];
80+
NSString* filePath = [outputPath stringByAppendingPathComponent:@"IncorrectHeaders/Readme.txt"];
81+
NSData* data = [NSData dataWithContentsOfFile:filePath];
8282

83-
NSString *actualReadmeTxtMD5 = [self _calculateMD5Digest:data];
83+
NSString* actualReadmeTxtMD5 = [self _calculateMD5Digest:data];
8484
STAssertTrue([actualReadmeTxtMD5 isEqualToString:intendedReadmeTxtMD5], @"Readme.txt MD5 digest should match original.");
8585
}
8686

8787
- (void)testUnzippingWithSymlinkedFileInside {
8888

89-
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"SymbolicLink" ofType:@"zip"];
90-
NSString *outputPath = [self _cachesPath:@"SymbolicLink"];
89+
NSString* zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"SymbolicLink" ofType:@"zip"];
90+
NSString* outputPath = [self _cachesPath:@"SymbolicLink"];
9191

9292
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
9393

94-
NSString *testSymlink = [outputPath stringByAppendingPathComponent:@"SymbolicLink/GitHub.app"];
94+
NSString* testSymlink = [outputPath stringByAppendingPathComponent:@"SymbolicLink/GitHub.app"];
9595

96-
NSError *error = nil;
97-
NSString *symlinkPath = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath:testSymlink error:&error];
96+
NSError* error = nil;
97+
NSString* symlinkPath = [[NSFileManager defaultManager] destinationOfSymbolicLinkAtPath:testSymlink error:&error];
9898

9999
bool symbolicLinkPersists = ((symlinkPath != nil) && [symlinkPath isEqualToString:@"/Applications/GitHub.app"]) && (error == nil);
100100

101101
STAssertTrue(symbolicLinkPersists, @"Symbolic links should persist from the original archive to the outputted files.");
102102
}
103103

104104

105-
- (void)testUnzippingWithUnicodeFilenameInside {
106-
NSString *zipPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"Unicode" ofType:@"zip"];
107-
NSString *outputPath = [self _cachesPath:@"Unicode"];
108-
109-
[SSZipArchive unzipFileAtPath:zipPath toDestination:outputPath delegate:self];
110-
111-
bool unicodeFilenameWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Unicode/Accént.txt"]];
112-
113-
bool unicodeFolderWasExtracted = [[NSFileManager defaultManager] fileExistsAtPath:[outputPath stringByAppendingPathComponent:@"Unicode/Fólder"]];
114-
115-
STAssertTrue(unicodeFilenameWasExtracted, @"Files with filenames in unicode should be extracted properly.");
116-
STAssertTrue(unicodeFolderWasExtracted, @"Folders with names in unicode should be extracted propertly.");
117-
}
118-
119-
120105
// Commented out to avoid checking in several gig file into the repository. Simply add a file named
121106
// `LargeArchive.zip` to the project and uncomment out these lines to test.
122107
//

0 commit comments

Comments
 (0)