#!/bin/sh

cat ../bin/schant-compiler.txt src/scheme/scheme.scm | \
  ../bin/schant-bigfloat8 \
  >scheme
cat ../bin/schant-compiler.txt src/scheme/callcc.scm | \
  ../bin/schant-bigfloat8 \
  >callcc
cat ../bin/schant-compiler.txt src/scheme/bigfloat8.scm | \
  ../bin/schant-bigfloat8 \
  >bigfloat8

cat scheme | ../bin/schant-bigfloat8 >result
diff -w -q result reference/scheme.txt
if [ $? = 0 ]; then
  echo "scheme test passes"
else
  echo "scheme test fails"
fi

cat callcc | ../bin/schant-bigfloat8 >result
diff -w -q result reference/callcc.txt
if [ $? = 0 ]; then
  echo "callcc test passes"
else
  echo "callcc test fails"
fi

cat bigfloat8 | ../bin/schant-bigfloat8 >result
diff -w -q result reference/bigfloat8.txt
if [ $? = 0 ]; then
  echo "bigfloat8 test passes"
else
  echo "bigfloat8 test fails"
fi

rm scheme callcc bigfloat8
