aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-08-22 12:41:55 -0700
committerRob Landley <rob@landley.net>2020-08-24 01:38:09 -0500
commitb9fa85fc5eb2e9484e000381154972b9bfef71eb (patch)
treeba2e78a71935e78ffab8e8524154fda6be707d39 /tests
parentd07f530f328cc1362d7100d3f040fabcc501af74 (diff)
downloadtoybox-b9fa85fc5eb2e9484e000381154972b9bfef71eb.tar.gz
tar: add -I (--use-compress-program) support.
This also changes the other compression options (such as -j) so that we pass no arguments for compression and just -d for decompression, which is what -I does to its filter and which appears sufficient. (I think I used -dc before just out of habit, since that's what I've been typing on the command line for decades.)
Diffstat (limited to 'tests')
-rw-r--r--tests/tar.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/tar.test b/tests/tar.test
index d6c505ae..0a91bac8 100644
--- a/tests/tar.test
+++ b/tests/tar.test
@@ -161,6 +161,13 @@ testing "manually specify bz2" 'LST -jf "$FILES"/tar/tar.tbz2' \
"drwxr-x--- enh/eng 0 2017-05-13 01:05 dir/\n-rw-r----- enh/eng 12 2017-05-13 01:05 dir/file\n" \
"" ""
+# -I
+testing "-I gzip c" "$TAR -Igzip file | file -" \
+ "/dev/stdin: gzip compressed data, from Unix\n" "" ""
+testing "-I gzip t" 'LST -Igzip -f "$FILES"/tar/tar.tgz' \
+ "drwxr-x--- enh/eng 0 2017-05-13 01:05 dir/\n-rw-r----- enh/eng 12 2017-05-13 01:05 dir/file\n" \
+ "" ""
+
skipnot mknod dir/char c 12 34 2>/dev/null
testing "character special" "tar --mtime @0 -cf test.tar dir/char && rm -f dir/char && tar xf test.tar && ls -l dir/char" \
"crw-rw---- 1 root root 12, 34 1970-01-01 00:00 dir/char\n" "" ""