File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ INTERP=${INTERP:-lua}
44SCRIPT=" UNZIP.LUA"
55R=0
66
7- # Inflate test
7+ # Store test
88TEST=" $SCRIPT store"
99DATA=$( readlink -f $( which $INTERP ) )
1010
@@ -105,4 +105,29 @@ else
105105 rm " ./$DATA " test.zip
106106fi
107107
108+ # mkdir test
109+ TEST=" $SCRIPT mkdir"
110+ DATA=$( readlink -f $( which $INTERP ) )
111+
112+ # Store a binary file in a zip
113+ cp $DATA .
114+ DATA=$( basename $DATA )
115+ SRC=" $( sha256sum ./$DATA ) "
116+ DIR=" foo/bar/baz"
117+ if [ -f test.zip ]; then rm " test.zip" ; fi
118+ zip test.zip -Z store " ./$DATA "
119+
120+ # Extract and compare
121+ rm " ./$DATA "
122+ $INTERP $SCRIPT test.zip -d " $DIR "
123+ if [ ! -e " $DIR /$DATA " ]; then
124+ echo " $TEST : FAIL" ; R=$(( R+ 1 )) ;
125+ else
126+ mv " $DIR /$DATA " .
127+ DST=" $( sha256sum ./$DATA ) "
128+ if [ " $SRC " = " $DST " ]; then echo " $TEST " : PASS; else echo " $TEST : FAIL" ; R=$(( R+ 1 )) ; fi
129+ rm " ./$DATA " test.zip
130+ rmdir -p $DIR
131+ fi
132+
108133exit $R
You can’t perform that action at this time.
0 commit comments