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 NetBSD 5.0) remove trailing spaces when wrapping.
28 echo ab cd | fold -b -s -w 3 | grep ' ' >/dev/null || {
29 echo "Skipping test: fold program trims trailing spaces"
30 rm -fr $tmpfiles; exit 77
33 # Some fold programs (like HP-UX) insert a newline at the end, if the last
34 # line was not terminated with a newline and the -s option was given.
35 foldoutputcount=`echo $ac_n "abc$ac_c" | fold -b -s -w 20 | wc -c`
36 foldoutputcount=`echo "$foldoutputcount" | sed -e 's/[ ]//g'`
37 test "$foldoutputcount" = 3 || {
38 echo "Skipping test: fold program inserts extra newline"
39 rm -fr $tmpfiles; exit 77
42 tmpfiles="$tmpfiles mfi-test3.properties"
43 cat <<\EOF > mfi-test3.properties
46 !=Project-Id-Version\: Bonnie Tyler\n
50 !The\ world\ is\ full\ of\ married\ men=So viele verheiratete M\u00e4nner
53 with\ wives\ who\ never\ understand=und ihre Frauen verstehen sie nicht
56 !They're\ looking\ for\ someone\ to\ share=
58 # schwer zu \u00fcbersetzen...
60 !the\ excitement\ of\ a\ love\ affair=
63 !Just\ as\ soon\ as\ they\ find\ you=
66 !They\ warn\ you\ and\ darn\ you=
69 tmpfiles="$tmpfiles mfi-test3.out"
70 : ${MSGFILTER=msgfilter}
72 ${MSGFILTER} --properties-input --properties-output -i mfi-test3.properties -o mfi-test3.out fold -b -s -w 20
74 test $result = 0 || { rm -fr $tmpfiles; exit 1; }
76 tmpfiles="$tmpfiles mfi-test3.ok"
77 cat <<\EOF > mfi-test3.ok
80 !=Project-Id-Version\: \nBonnie Tyler\n
84 !The\ world\ is\ full\ of\ married\ men=So viele \nverheiratete M\u00e4nner
87 with\ wives\ who\ never\ understand=und ihre Frauen \nverstehen sie nicht
90 !They're\ looking\ for\ someone\ to\ share=
92 # schwer zu \u00fcbersetzen...
94 !the\ excitement\ of\ a\ love\ affair=
97 !Just\ as\ soon\ as\ they\ find\ you=
100 !They\ warn\ you\ and\ darn\ you=
104 ${DIFF} mfi-test3.ok mfi-test3.out