diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-08-02 11:10:31 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-08-02 11:10:31 +0200 |
commit | 8331f1f44822f6bac623baab10d76fdf6e64b3f7 (patch) | |
tree | c0df8754c142c6d6923ca0d85e9bdd0e601f344d | |
parent | 8ae55d68448098e1830dc09f9e658fb534aa0dc6 (diff) | |
download | rpg-8331f1f44822f6bac623baab10d76fdf6e64b3f7.tar.gz rpg-8331f1f44822f6bac623baab10d76fdf6e64b3f7.tar.bz2 |
FS#2802 correctly fix tar tests
When the DokuWiki install was in a deep namespace, the used path name
could land in the >100 char limit and trigger ustar format where the
filename and directory name are split. This would fail the test.
-rw-r--r-- | _test/tests/inc/tar.test.php | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/_test/tests/inc/tar.test.php b/_test/tests/inc/tar.test.php index 50664cfc3..9801ca1e0 100644 --- a/_test/tests/inc/tar.test.php +++ b/_test/tests/inc/tar.test.php @@ -25,11 +25,17 @@ class Tar_TestCase extends DokuWikiTest { $this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR'); $this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR'); - $this->assertTrue(strpos($data, "$tdir/testdata1.txt") !== false, 'Path in TAR'); + // fullpath might be too long to be stored as full path FS#2802 + $this->assertTrue(strpos($data, "$tdir") !== false, 'Path in TAR'); + $this->assertTrue(strpos($data, "testdata1.txt") !== false, 'File in TAR'); + $this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR'); $this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR'); - $this->assertTrue(strpos($data, "$tdir/foobar/testdata2.txt") === false, 'Path not in TAR'); + // fullpath might be too long to be stored as full path FS#2802 + $this->assertTrue(strpos($data, "$tdir/foobar") === false, 'Path not in TAR'); + $this->assertTrue(strpos($data, "foobar.txt") === false, 'File not in TAR'); + $this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR'); } @@ -59,11 +65,17 @@ class Tar_TestCase extends DokuWikiTest { $this->assertTrue(strpos($data, 'testcontent2') !== false, 'Content in TAR'); $this->assertTrue(strpos($data, 'testcontent3') !== false, 'Content in TAR'); - $this->assertTrue(strpos($data, "$tdir/testdata1.txt") !== false, 'Path in TAR'); + // fullpath might be too long to be stored as full path FS#2802 + $this->assertTrue(strpos($data, "$tdir") !== false, 'Path in TAR'); + $this->assertTrue(strpos($data, "testdata1.txt") !== false, 'File in TAR'); + $this->assertTrue(strpos($data, 'noway/testdata2.txt') !== false, 'Path in TAR'); $this->assertTrue(strpos($data, 'another/testdata3.txt') !== false, 'Path in TAR'); - $this->assertTrue(strpos($data, "$tdir/foobar/testdata2.txt") === false, 'Path not in TAR'); + // fullpath might be too long to be stored as full path FS#2802 + $this->assertTrue(strpos($data, "$tdir/foobar") === false, 'Path not in TAR'); + $this->assertTrue(strpos($data, "foobar.txt") === false, 'File not in TAR'); + $this->assertTrue(strpos($data, "foobar") === false, 'Path not in TAR'); @unlink($tmp); |