#!/bin/sh

cd testdir || { echo "ERROR: Could not change to test directory" ; exit 1; } >&2

banner="Repairing two files using PAR 2.0 data"
dashes=`echo "$banner" | sed s/./-/g`

echo $dashes
echo $banner
echo $dashes

rm -f test-1.data test-3.data
../par2 r testdata.par2 > ../test4.log || { echo "ERROR: Reconstruction of two files using PAR 2.0 failed" ; exit 1; } >&2
cmp -s test-1.data test-1.data.orig && cmp -s test-3.data test-3.data.orig || { echo "ERROR: Repaired files do not match originals" ; exit 1; } >&2

rm -f ../test4.log

exit 0;

