diff --git a/unit-tests/nlambda.sh b/unit-tests/nlambda.sh new file mode 100644 index 0000000..f267527 --- /dev/null +++ b/unit-tests/nlambda.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +expected='a' +actual=`echo "((nlambda (x) x) a)" | target/psse 2> /dev/null | head -2 | tail -1` + +if [ "${expected}" = "${actual}" ] +then + echo "OK" + exit 0 +else + echo "Fail: expected '${expected}', got '${actual}'" + exit 1 +fi diff --git a/unit-tests/string-allocation.sh b/unit-tests/string-allocation.sh index 7fe78c4..6f55143 100644 --- a/unit-tests/string-allocation.sh +++ b/unit-tests/string-allocation.sh @@ -1,17 +1,15 @@ #!/bin/bash -log=log.$$ value='"Fred"' -expected="String cell: character 'F' (70)" -echo ${value} | target/psse -d > ${log} 2>/dev/null -grep "${expected}" ${log} > /dev/null +expected="String cell: character 'F'" +# set! protects "Fred" from the garbage collector. +actual=`echo "(set! x ${value})" | target/psse -d 2>&1 | grep "$expected" | sed 's/ *\(.*\) next.*$/\1/'` if [ $? -eq 0 ] then echo "OK" - rm ${log} exit 0 else - echo "Expected '${expected}', not found in ${log}" + echo "Fail: expected '${expected}', got '${actual}'" exit 1 fi