4 # Copyright 2006 Rob Landley <rob@landley.net>
5 # Copyright 2006 Glenn McGrath
6 # Licensed under GPLv2, see file LICENSE in this source tree.
10 # testing "test name" "commands" "expected result" "file input" "stdin"
11 # file input will be file called "input"
12 # test can create a file "actual" instead of writing to stdout
14 # Create a scratch directory
19 # Create test file to work with.
23 zip foo.zip foo foo/bar > /dev/null
27 # Test that unzipping just foo doesn't create bar.
28 testing "unzip (subdir only)" "unzip -q foo.zip foo/ && test -d foo && test ! -f foo/bar && echo yes" "yes\n" "" ""
33 # File containing some damaged encrypted stream
34 optional FEATURE_UNZIP_CDF
35 testing "unzip (bad archive)" "uudecode; unzip bad.zip 2>&1; echo \$?" \
37 inflating: ]3j½r«I
\e\12K-%Ix
43 begin-base64 644 bad.zip
44 UEsDBBQAAgkIAAAAIQA5AAAANwAAADwAAAAQAAcAXTNqwr1ywqtJGxJLLSVJ
45 eCkBD0AdKBk8JzQsIj01JC0/ORJQSwMEFAECCAAAAAAhADoAAAAPAAAANgAA
46 AAwAAQASw73Ct1DCokohPXQiNjoUNTUiHRwgLT4WHlBLAQIQABQAAggIAAAA
47 oQA5AAAANwAAADwAAAAQQAcADAAAACwAMgCAAAAAAABdM2rCvXLCq0kbEkst
48 JUl4KQEPQB0oGSY4Cz4QNgEnJSYIPVBLAQIAABQAAggAAAAAIQAqAAAADwAA
49 BDYAAAAMAAEADQAAADIADQAAAEEAAAASw73Ct1DKokohPXQiNzA+FAI1HCcW
50 NzITNFBLBQUKAC4JAA04Cw0EOhZQSwUGAQAABAIAAgCZAAAAeQAAAAIALhM=
57 # Clean up scratch directory.