Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
Zip
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Jira
Jira
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
YongYue
Zip
Commits
8caea5c4
Commit
8caea5c4
authored
Jan 16, 2016
by
Roy Marmelstein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional tests, path fixing
parent
d3e733d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
Zip/Zip.swift
Zip/Zip.swift
+1
-1
ZipTests/ZipTests.swift
ZipTests/ZipTests.swift
+13
-2
No files found.
Zip/Zip.swift
View file @
8caea5c4
...
@@ -174,7 +174,7 @@ public class Zip {
...
@@ -174,7 +174,7 @@ public class Zip {
var
totalSize
:
Double
=
0.0
var
totalSize
:
Double
=
0.0
// Check if paths exist and get totalSize for progress handler
// Check if paths exist and get totalSize for progress handler
for
path
in
paths
{
for
path
in
paths
{
if
fileManager
.
fileExistsAtPath
(
path
.
absoluteString
)
==
false
{
if
fileManager
.
fileExistsAtPath
(
path
.
path
!
)
==
false
{
throw
ZipError
.
FileNotFound
throw
ZipError
.
FileNotFound
}
}
do
{
do
{
...
...
ZipTests/ZipTests.swift
View file @
8caea5c4
...
@@ -67,7 +67,18 @@ class ZipTests: XCTestCase {
...
@@ -67,7 +67,18 @@ class ZipTests: XCTestCase {
XCTFail
()
XCTFail
()
}
}
}
}
func
testQuickZip
()
{
do
{
let
imageURL1
=
NSBundle
(
forClass
:
ZipTests
.
self
)
.
URLForResource
(
"3crBXeO"
,
withExtension
:
"gif"
)
!
let
imageURL2
=
NSBundle
(
forClass
:
ZipTests
.
self
)
.
URLForResource
(
"kYkLkPf"
,
withExtension
:
"gif"
)
!
let
destinationURL
=
try
Zip
()
.
quickZipFiles
([
imageURL1
,
imageURL2
],
fileName
:
"archive"
)
let
fileManager
=
NSFileManager
.
defaultManager
()
XCTAssertTrue
(
fileManager
.
fileExistsAtPath
(
destinationURL
.
path
!
))
}
catch
{
XCTFail
()
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment