#!/bin/bash


cat $1 | sed -e "/^   /d" > $1.jak
cat $2 | sed -e "/^   /d" > $2.jak
cat $3 | sed -e "/^   /d" > $3.jak

echo -n "uncomposing $4 into $1 & $2 & $3..."

if ! java unmixin.Main $4 ; then
   echo "call to unmixin failed"
   exit 1
fi

bash regress-test $1 \
&& bash regress-test $2 \
&& bash regress-test $3 \
|| exit 1

echo "succeeded"
