New unit tests.

This commit is contained in:
Simon Brooke 2017-09-25 10:01:25 +01:00
parent b713c1822d
commit 832ae3be0d
2 changed files with 39 additions and 0 deletions

26
unit-tests/add.sh Normal file
View file

@ -0,0 +1,26 @@
#!/bin/bash
expected='5'
actual=`echo "(add 2 3)" | target/psse 2> /dev/null | head -1`
if [ "${expected}" = "${actual}" ]
then
echo "OK"
exit 0
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi
expected='5.5000'
actual=`echo "(add 2.5 3)" | target/psse 2> /dev/null | head -1`
if [ "${expected}" = "${actual}" ]
then
echo "OK"
exit 0
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi

13
unit-tests/apply.sh Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
expected='1'
actual=`echo "(apply 'add '(1))"| target/psse 2> /dev/null | head -1`
if [ "${expected}" = "${actual}" ]
then
echo "OK"
exit 0
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi