Skip to content

Commit 4b63676

Browse files
committed
Added unit test for SQUISH.LUA
1 parent b63d543 commit 4b63676

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

test/SQUISH/SQUISH.LUA

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

test/SQUISH/test.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
INTERP=${INTERP:-lua}
4+
SCRIPT="SQUISH.LUA"
5+
6+
mkdir -p test
7+
cp $SCRIPT test
8+
SCRIPT="test/$SCRIPT"
9+
BEFORE=$(stat -L -c%s "$SCRIPT")
10+
$INTERP $SCRIPT $SCRIPT
11+
AFTER=$(stat -L -c%s "$SCRIPT")
12+
if [ "$AFTER" -ge "$BEFORE" ]; then echo "SQUISH: FAIL"; exit 1; fi
13+
$INTERP $SCRIPT $SCRIPT
14+
FINAL=$(stat -L -c%s "$SCRIPT")
15+
echo
16+
17+
rm -R test
18+
19+
if [ "$AFTER" -eq "$FINAL" ]; then
20+
echo "SQUISH: PASS";
21+
else
22+
echo "SQUISH: FAIL"; exit 1;
23+
fi

0 commit comments

Comments
 (0)