box-o-sand/lcthw-remnants/test.sh

36 lines
532 B
Bash
Raw Normal View History

EXIT_CODE=0
ASSERT_COUNT=0
function assert_equal(){
if [[ $1 == $2 ]] ; then
echo -n "."
else
echo -n "F"
EXIT_CODE=1
fi
ASSERT_COUNT=$(expr $ASSERT_COUNT + 1)
}
function assert_not_equal(){
if [[ $1 != $2 ]] ; then
echo -n "."
else
echo -n "F"
EXIT_CODE=1
fi
ASSERT_COUNT=$(expr $ASSERT_COUNT + 1)
}
function test_finish(){
echo
if [ $EXIT_CODE -eq 0 ]; then
echo "PASS"
else
echo "FAIL"
fi
exit $EXIT_CODE
}