diff options
author | Elliott Hughes <enh@google.com> | 2017-05-12 18:30:03 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2017-05-19 13:11:12 -0500 |
commit | 83b3531ec2876fa76817501bf1a38d4438ac39e6 (patch) | |
tree | 8f8ac8464695f54d269f286af18d6ccff74347b6 /tests | |
parent | d852ec18900ef635a38f99ed769a636f15af72c6 (diff) | |
download | toybox-83b3531ec2876fa76817501bf1a38d4438ac39e6.tar.gz |
Add bzip2 support to tar.
Also trivial cleanup of pipe -> xpipe.
Bug: http://b/38215123
Diffstat (limited to 'tests')
-rw-r--r-- | tests/files/tar/tar.tbz2 | bin | 0 -> 168 bytes | |||
-rw-r--r-- | tests/files/tar/tar.tgz | bin | 0 -> 166 bytes | |||
-rwxr-xr-x | tests/tar.test | 14 |
3 files changed, 14 insertions, 0 deletions
diff --git a/tests/files/tar/tar.tbz2 b/tests/files/tar/tar.tbz2 Binary files differnew file mode 100644 index 00000000..cb86319b --- /dev/null +++ b/tests/files/tar/tar.tbz2 diff --git a/tests/files/tar/tar.tgz b/tests/files/tar/tar.tgz Binary files differnew file mode 100644 index 00000000..f40c9c06 --- /dev/null +++ b/tests/files/tar/tar.tgz diff --git a/tests/tar.test b/tests/tar.test index 80ba5551..50a94e60 100755 --- a/tests/tar.test +++ b/tests/tar.test @@ -88,3 +88,17 @@ f="filename_with_50_chars_xxxxxxxxxxxxxxxxxxxxxxxxxxx" mkdir $d echo "This is testdata" > $d/$f testing "longname pathname" "tar -cf testFile.tar $d/$f && [ -e testFile.tar ] && echo 'yes'; rm -rf $d; tar -xf testFile.tar && [ -f $d/$f ] && cat $d/$f && strings testFile.tar | grep -o LongLink; rm -f testFile.tar; rm -rf $d" "yes\nThis is testdata\nLongLink\n" "" "" + +# gzip +rm -rf d +mkdir d +echo "hello world" > d/f +testing "gzip compression" "tar zcf f d && file f | grep -q gzip && echo y ; rm -rf d ; tar xf f && cat d/f" "y\nhello world\n" "" "" +testing "gzip decompression" "tar xf $FILES/tar/tar.tgz && cat dir/file" "hello world\n" "" "" + +# bzip2 +rm -rf d +mkdir d +echo "hello world" > d/f +testing "bzip2 compression" "tar jcf f d && file f | grep -q bzip2 && echo y ; rm -rf d ; tar xf f && cat d/f" "y\nhello world\n" "" "" +testing "bzip2 decompression" "tar xf $FILES/tar/tar.tbz2 && cat dir/file" "hello world\n" "" "" |