Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
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
Model 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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
5f0edced
Commit
5f0edced
authored
11 years ago
by
Andreas Gohr
Browse files
Options
Downloads
Patches
Plain Diff
added test case for FS#1442
parent
7d8a6abb
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
_test/tests/inc/tar.test.php
+23
-1
23 additions, 1 deletion
_test/tests/inc/tar.test.php
with
23 additions
and
1 deletion
_test/tests/inc/tar.test.php
+
23
−
1
View file @
5f0edced
...
...
@@ -248,6 +248,28 @@ class Tar_TestCase extends DokuWikiTest {
}
}
// FS#1442
public
function
test_createlongfile
()
{
$tar
=
new
Tar
();
$tmp
=
tempnam
(
sys_get_temp_dir
(),
'dwtartest'
);
$path
=
'0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789.txt'
;
$tar
->
create
(
$tmp
,
Tar
::
COMPRESS_NONE
);
$tar
->
addData
(
$path
,
'testcontent1'
);
$tar
->
close
();
$this
->
assertTrue
(
filesize
(
$tmp
)
>
30
);
//arbitrary non-zero number
$data
=
file_get_contents
(
$tmp
);
// We should find the complete path and a longlink entry
$this
->
assertTrue
(
strpos
(
$data
,
'testcontent1'
)
!==
false
,
'content in TAR'
);
$this
->
assertTrue
(
strpos
(
$data
,
$path
)
!==
false
,
'path in TAR'
);
$this
->
assertTrue
(
strpos
(
$data
,
'@LongLink'
)
!==
false
,
'@LongLink in TAR'
);
@
unlink
(
$tmp
);
}
public
function
test_createlongpathustar
()
{
$tar
=
new
Tar
();
$tmp
=
tempnam
(
sys_get_temp_dir
(),
'dwtartest'
);
...
...
@@ -360,4 +382,4 @@ class Tar_TestCase extends DokuWikiTest {
$this
->
assertEquals
(
512
*
4
,
strlen
(
$file
));
// 1 header block + data block + 2 footer blocks
}
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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