3
# Test general filter execution with Java .properties syntax.
6
trap 'rm -fr $tmpfiles' 1 2 3 15
8
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
9
# Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
10
if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
20
# Some fold programs (like SunOS4 and FreeBSD) don't have an option to wrap at
22
echo abc | fold -b -s -w 20 >/dev/null 2>&1 || {
23
echo "Skipping test: fold program not POSIX compliant"
24
rm -fr $tmpfiles; exit 77
27
# Some fold programs (like HP-UX) insert a newline at the end, if the last
28
# line was not terminated with a newline and the -s option was given.
29
foldoutputcount=`echo $ac_n "abc$ac_c" | fold -b -s -w 20 | wc -c`
30
foldoutputcount=`echo "$foldoutputcount" | sed -e 's/[ ]//g'`
31
test "$foldoutputcount" = 3 || {
32
echo "Skipping test: fold program inserts extra newline"
33
rm -fr $tmpfiles; exit 77
36
tmpfiles="$tmpfiles mfi-test3.properties"
37
cat <<\EOF > mfi-test3.properties
40
!=Project-Id-Version\: Bonnie Tyler\n
44
!The\ world\ is\ full\ of\ married\ men=So viele verheiratete M\u00e4nner
47
with\ wives\ who\ never\ understand=und ihre Frauen verstehen sie nicht
50
!They're\ looking\ for\ someone\ to\ share=
52
# schwer zu \u00fcbersetzen...
54
!the\ excitement\ of\ a\ love\ affair=
57
!Just\ as\ soon\ as\ they\ find\ you=
60
!They\ warn\ you\ and\ darn\ you=
63
tmpfiles="$tmpfiles mfi-test3.out"
64
: ${MSGFILTER=msgfilter}
66
${MSGFILTER} --properties-input --properties-output -i mfi-test3.properties -o mfi-test3.out fold -b -s -w 20
68
test $result = 0 || { rm -fr $tmpfiles; exit 1; }
70
tmpfiles="$tmpfiles mfi-test3.ok"
71
cat <<\EOF > mfi-test3.ok
74
!=Project-Id-Version\: \nBonnie Tyler\n
78
!The\ world\ is\ full\ of\ married\ men=So viele \nverheiratete M\u00e4nner
81
with\ wives\ who\ never\ understand=und ihre Frauen \nverstehen sie nicht
84
!They're\ looking\ for\ someone\ to\ share=
86
# schwer zu \u00fcbersetzen...
88
!the\ excitement\ of\ a\ love\ affair=
91
!Just\ as\ soon\ as\ they\ find\ you=
94
!They\ warn\ you\ and\ darn\ you=
98
${DIFF} mfi-test3.ok mfi-test3.out