post-scarcity/unit-tests/where-does-it-break.sh

30 lines
639 B
Bash
Executable file

#!/bin/bash
# Not really a unit test, but a check to see where bignum addition breaks
broken=0
i=1152921506900200000
# we've already proven we can successfullu get up to here
increment=10000
while [ $broken -eq "0" ]
do
expr="(+ $i $increment)"
# Use sbcl as our reference implementation...
expected=`echo "$expr" | sbcl --noinform | grep -v '*'`
actual=`echo "$expr" | target/psse | tail -1 | sed 's/\,//g'`
echo -n "adding $increment to $i: "
if [ "${expected}" = "${actual}" ]
then
echo "OK"
else
echo "Fail: expected '${expected}', got '${actual}'"
broken=1
exit 1
fi
i=$expected
done