#!/bin/sh
: ${srcdir=.}
failures=0
cat <<EOF >patfile
radar
MILES
GNU
EOF
echo "miles" | ${GREP} -i -E -f patfile > /dev/null 2>&1
if test $? -ne 0 ; then
echo "File_pattern: Wrong status code, test \#1 failed"
failures=1
fi
echo "GNU" | ${GREP} -G -f patfile > /dev/null 2>&1
if test $? -ne 0 ; then
echo "File_pattern: Wrong status code, test \#2 failed"
failures=1
fi
echo "ridar" | ${GREP} -F -f patfile > /dev/null 2>&1
if test $? -ne 1 ; then
echo "File_pattern: Wrong status code, test \#3 failed"
failures=1
fi
cat <<EOF >patfile
EOF
echo "abbcd" | ${GREP} -F -f patfile > /dev/null 2>&1
if test $? -ne 0 ; then
echo "File_pattern: Wrong status code, test \#4 failed"
failures=1
fi
cp /dev/null patfile
echo "abbcd" | ${GREP} -F -f patfile > /dev/null 2>&1
if test $? -ne 1 ; then
echo "File_pattern: Wrong status code, test \#5 failed"
failures=1
fi
exit $failures