post-scarcity/where-does-it-break.sh
Simon Brooke 0f8bc990f2 Much investigation of bignum problems
bignum multiply is still not working, but as bignum read and bignum divide depend on it, it's the problem to hit first.
2019-01-19 16:28:15 +00:00

30 lines
636 B
Bash
Executable file

#!/bin/bash
# Not really a unit test, but a check to see where bignum addition breaks
broken=0
i=11529215046068469750
# we've already proven we can successfullu get up to here
increment=1
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