post-scarcity/unit-tests/lambda.sh
Simon Brooke 93d4bd14a0
Generally, changed working with tags as strings to as values.
This seems both cheaper and safer; what's not to like?
2021-08-17 16:09:00 +01:00

18 lines
355 B
Bash
Executable file

#!/bin/bash
expected='<Anonymous Function: (λ (l) l)> (1 2 3 4 5 6 7 8 9 10)'
output=`target/psse 2>/dev/null <<EOF
(set! list (lambda (l) l))
(list '(1 2 3 4 5 6 7 8 9 10))
EOF`
actual=`echo $output | tail -1`
if [ "${expected}" = "${actual}" ]
then
echo "OK"
exit 0
else
echo "Fail: expected '${expected}', got '${actual}'"
exit 1
fi