Skip to content

Commit 658a695

Browse files
committed
Initial implementation of UNZIP.LUA unit test.
1 parent 15a3199 commit 658a695

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

meta/test/unzip/UNZIP.LUA

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../util/UNZIP.LUA

meta/test/unzip/test.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
INTERP=${INTERP:-lua}
4+
SCRIPT="UNZIP.LUA"
5+
6+
# Compress a binary file
7+
cp `which $INTERP` .
8+
SRC="$(sha256sum ./$INTERP)"
9+
if [ -f test.zip ]; then rm "test.zip"; fi
10+
zip test.zip "./$INTERP"
11+
12+
# Extract and compare
13+
rm "./$INTERP"
14+
$INTERP $SCRIPT test.zip
15+
DST="$(sha256sum ./$INTERP)"
16+
if [ "$SRC" = "$DST" ]; then echo "$SCRIPT": PASS; else echo "$SCRIPT: FAIL"; fi
17+
18+
# Clean up
19+
rm "./$INTERP" test.zip

0 commit comments

Comments
 (0)