@@ -70,53 +70,38 @@ - (void)testUnzippingWithPassword {
70
70
}
71
71
72
72
- (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" ];
75
75
76
76
[SSZipArchive unzipFileAtPath: zipPath toDestination: outputPath delegate: self ];
77
77
78
- NSString * intendedReadmeTxtMD5 = @" 31ac96301302eb388070c827447290b5" ;
78
+ NSString * intendedReadmeTxtMD5 = @" 31ac96301302eb388070c827447290b5" ;
79
79
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];
82
82
83
- NSString * actualReadmeTxtMD5 = [self _calculateMD5Digest: data];
83
+ NSString * actualReadmeTxtMD5 = [self _calculateMD5Digest: data];
84
84
STAssertTrue ([actualReadmeTxtMD5 isEqualToString: intendedReadmeTxtMD5], @" Readme.txt MD5 digest should match original." );
85
85
}
86
86
87
87
- (void )testUnzippingWithSymlinkedFileInside {
88
88
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" ];
91
91
92
92
[SSZipArchive unzipFileAtPath: zipPath toDestination: outputPath delegate: self ];
93
93
94
- NSString * testSymlink = [outputPath stringByAppendingPathComponent: @" SymbolicLink/GitHub.app" ];
94
+ NSString * testSymlink = [outputPath stringByAppendingPathComponent: @" SymbolicLink/GitHub.app" ];
95
95
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];
98
98
99
99
bool symbolicLinkPersists = ((symlinkPath != nil ) && [symlinkPath isEqualToString: @" /Applications/GitHub.app" ]) && (error == nil );
100
100
101
101
STAssertTrue (symbolicLinkPersists, @" Symbolic links should persist from the original archive to the outputted files." );
102
102
}
103
103
104
104
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
-
120
105
// Commented out to avoid checking in several gig file into the repository. Simply add a file named
121
106
// `LargeArchive.zip` to the project and uncomment out these lines to test.
122
107
//
0 commit comments