Commit 03aab4bf authored by József Vesza's avatar József Vesza

Fixed inverted logic, removed unnecessary test files.

parent d0006699
...@@ -79,8 +79,6 @@ ...@@ -79,8 +79,6 @@
347E3AD81C1E04C900A11FD3 /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347E3AD71C1E04C900A11FD3 /* Zip.swift */; }; 347E3AD81C1E04C900A11FD3 /* Zip.swift in Sources */ = {isa = PBXBuildFile; fileRef = 347E3AD71C1E04C900A11FD3 /* Zip.swift */; };
34940A241C58876200D41574 /* 3crBXeO.gif in Resources */ = {isa = PBXBuildFile; fileRef = 34940A221C58876200D41574 /* 3crBXeO.gif */; }; 34940A241C58876200D41574 /* 3crBXeO.gif in Resources */ = {isa = PBXBuildFile; fileRef = 34940A221C58876200D41574 /* 3crBXeO.gif */; };
34940A251C58876200D41574 /* kYkLkPf.gif in Resources */ = {isa = PBXBuildFile; fileRef = 34940A231C58876200D41574 /* kYkLkPf.gif */; }; 34940A251C58876200D41574 /* kYkLkPf.gif in Resources */ = {isa = PBXBuildFile; fileRef = 34940A231C58876200D41574 /* kYkLkPf.gif */; };
BBF824D51CA60383008FF3C5 /* bb8.cbz in Resources */ = {isa = PBXBuildFile; fileRef = BBF824D31CA60383008FF3C5 /* bb8.cbz */; };
BBF824D61CA60383008FF3C5 /* bb8.xyz in Resources */ = {isa = PBXBuildFile; fileRef = BBF824D41CA60383008FF3C5 /* bb8.xyz */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -145,8 +143,6 @@ ...@@ -145,8 +143,6 @@
347E3AD71C1E04C900A11FD3 /* Zip.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Zip.swift; sourceTree = "<group>"; }; 347E3AD71C1E04C900A11FD3 /* Zip.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Zip.swift; sourceTree = "<group>"; };
34940A221C58876200D41574 /* 3crBXeO.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = 3crBXeO.gif; path = Images/3crBXeO.gif; sourceTree = "<group>"; }; 34940A221C58876200D41574 /* 3crBXeO.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = 3crBXeO.gif; path = Images/3crBXeO.gif; sourceTree = "<group>"; };
34940A231C58876200D41574 /* kYkLkPf.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = kYkLkPf.gif; path = Images/kYkLkPf.gif; sourceTree = "<group>"; }; 34940A231C58876200D41574 /* kYkLkPf.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; name = kYkLkPf.gif; path = Images/kYkLkPf.gif; sourceTree = "<group>"; };
BBF824D31CA60383008FF3C5 /* bb8.cbz */ = {isa = PBXFileReference; lastKnownFileType = file; path = bb8.cbz; sourceTree = "<group>"; };
BBF824D41CA60383008FF3C5 /* bb8.xyz */ = {isa = PBXFileReference; lastKnownFileType = file; path = bb8.xyz; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -266,8 +262,6 @@ ...@@ -266,8 +262,6 @@
347E3A821C1DFFB500A11FD3 /* ZipTests */ = { 347E3A821C1DFFB500A11FD3 /* ZipTests */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
BBF824D31CA60383008FF3C5 /* bb8.cbz */,
BBF824D41CA60383008FF3C5 /* bb8.xyz */,
34940A221C58876200D41574 /* 3crBXeO.gif */, 34940A221C58876200D41574 /* 3crBXeO.gif */,
34940A231C58876200D41574 /* kYkLkPf.gif */, 34940A231C58876200D41574 /* kYkLkPf.gif */,
3443A3FC1C4AD199004AD173 /* bb8.zip */, 3443A3FC1C4AD199004AD173 /* bb8.zip */,
...@@ -473,11 +467,9 @@ ...@@ -473,11 +467,9 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
BBF824D51CA60383008FF3C5 /* bb8.cbz in Resources */,
34940A251C58876200D41574 /* kYkLkPf.gif in Resources */, 34940A251C58876200D41574 /* kYkLkPf.gif in Resources */,
3443A3FD1C4AD199004AD173 /* bb8.zip in Resources */, 3443A3FD1C4AD199004AD173 /* bb8.zip in Resources */,
34940A241C58876200D41574 /* 3crBXeO.gif in Resources */, 34940A241C58876200D41574 /* 3crBXeO.gif in Resources */,
BBF824D61CA60383008FF3C5 /* bb8.xyz in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
......
...@@ -292,6 +292,6 @@ public class Zip { ...@@ -292,6 +292,6 @@ public class Zip {
guard let fileExtension = fileExtension else { return true } guard let fileExtension = fileExtension else { return true }
return ["zip", "cbz"].contains(fileExtension) return !["zip", "cbz"].contains(fileExtension)
} }
} }
\ No newline at end of file
...@@ -166,14 +166,14 @@ class ZipTests: XCTestCase { ...@@ -166,14 +166,14 @@ class ZipTests: XCTestCase {
} }
func testFileExtensionIsInvalidForValidUrl() { func testFileExtensionIsInvalidForValidUrl() {
let fileUrl = NSBundle(forClass: ZipTests.self).URLForResource("bb8", withExtension: "cbz") let fileUrl = NSURL(string: "file.cbz")
let result = Zip.fileExtensionIsInvalid(fileUrl?.pathExtension) let result = Zip.fileExtensionIsInvalid(fileUrl?.pathExtension)
XCTAssertTrue(result) XCTAssertFalse(result)
} }
func testFileExtensionIsInvalidForInvalidUrl() { func testFileExtensionIsInvalidForInvalidUrl() {
let fileUrl = NSBundle(forClass: ZipTests.self).URLForResource("bb8", withExtension: "xyz") let fileUrl = NSURL(string: "file.xyz")
let result = Zip.fileExtensionIsInvalid(fileUrl?.pathExtension) let result = Zip.fileExtensionIsInvalid(fileUrl?.pathExtension)
XCTAssertFalse(result) XCTAssertTrue(result)
} }
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment