#!/bin/sh ORIG="./.check-xxber.orig.$$.tmp" TEST="./.check-xxber.test.$$.tmp" # Test diff(1) capabilities diff -a . . 2>/dev/null && diffArgs="-a" # Assume text files diff -u . . 2>/dev/null && diffArgs="$diffArgs -u" # Unified diff output cat< $ORIG

US

1¦ G

1¦ G

1¦ G

EOM ./enber $ORIG | ./unber -p -i 0 - > $TEST 2>&1 diff $diffArgs $ORIG $TEST >/dev/null 2>&1 diffExitCode=$? if [ "$diffExitCode" = "0" ]; then echo "FAILED: $0: expected failure, got success" exit 42; fi # Append necessary terminator echo '
' >> $ORIG # Try trancoding again ./enber $ORIG | ./unber -p -i 0 - > $TEST 2>&1 diff $diffArgs $ORIG $TEST diffExitCode=$? rm -f $ORIG $TEST exit $diffExitCode