Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
9ea373a2
Commit
9ea373a2
authored
10 years ago
by
Alessandro Vullo
Browse files
Options
Downloads
Patches
Plain Diff
Some zip related tests.
parent
62e6ea58
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/t/io.t
+30
-1
30 additions, 1 deletion
modules/t/io.t
with
30 additions
and
1 deletion
modules/t/io.t
+
30
−
1
View file @
9ea373a2
...
@@ -51,7 +51,7 @@ eval {
...
@@ -51,7 +51,7 @@ eval {
};
};
SKIP:
{
SKIP:
{
skip
"
Cannot run Bzip tests, install related IO::[Un]Compress modules first
",
skip
"
Cannot run Bzip
2/Bunzip2
tests, install related IO::[Un]Compress modules first
",
2
unless
$BZIP2_OK
;
2
unless
$BZIP2_OK
;
# send the content of the tmpfile to another
# send the content of the tmpfile to another
...
@@ -71,6 +71,35 @@ SKIP: {
...
@@ -71,6 +71,35 @@ SKIP: {
like
(
$content
,
qr/more data/
,
"
Bzip2: more correct content
");
like
(
$content
,
qr/more data/
,
"
Bzip2: more correct content
");
}
}
my
$ZIP_OK
=
0
;
eval
{
require
IO::Compress::
Zip
;
require
IO::Uncompress::
Unzip
;
$ZIP_OK
=
1
;
};
SKIP:
{
skip
"
Cannot run Zip/Unzip tests, install related IO::[Un]Compress modules first
",
2
unless
$BZIP2_OK
;
# send the content of the tmpfile to another
# bzip2 compressed file
my
$file_content
=
slurp
(
$tmpfilename
);
my
$bz2tmpfile
=
File::
Temp
->
new
(
DIR
=>
$dirname
,
SUFFIX
=>
'
.bz2
');
zip_work_with_file
(
$bz2tmpfile
->
filename
,
'
w
',
sub
{
my
(
$fh
)
=
@_
;
print
$fh
$file_content
;
return
;
});
# check the content of the compressed file
my
$content
=
zip_slurp
(
$bz2tmpfile
->
filename
);
like
(
$content
,
qr/test data/
,
"
Zip: correct content
");
like
(
$content
,
qr/more data/
,
"
Zip: more correct content
");
}
#
#
# test filtering the content of a directory
# test filtering the content of a directory
#
#
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment