2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test general filter execution with Java .properties syntax.
6 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
7 # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
8 if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
18 # Some fold programs (like SunOS4 and FreeBSD) don't have an option to wrap at
20 echo abc | fold -b -s -w 20 >/dev/null 2>&1 || {
21 echo "Skipping test: fold program not POSIX compliant"
25 # Some fold programs (like NetBSD 5.0) remove trailing spaces when wrapping.
26 echo ab cd | fold -b -s -w 3 | grep ' ' >/dev/null || {
27 echo "Skipping test: fold program trims trailing spaces"
31 # Some fold programs (like HP-UX) insert a newline at the end, if the last
32 # line was not terminated with a newline and the -s option was given.
33 foldoutputcount=`echo $ac_n "abc$ac_c" | fold -b -s -w 20 | wc -c`
34 foldoutputcount=`echo "$foldoutputcount" | sed -e 's/[ ]//g'`
35 test "$foldoutputcount" = 3 || {
36 echo "Skipping test: fold program inserts extra newline"
40 cat <<\EOF > mfi-test3.properties
43 !=Project-Id-Version\: Bonnie Tyler\n
47 !The\ world\ is\ full\ of\ married\ men=So viele verheiratete M\u00e4nner
50 with\ wives\ who\ never\ understand=und ihre Frauen verstehen sie nicht
53 !They're\ looking\ for\ someone\ to\ share=
55 # schwer zu \u00fcbersetzen...
57 !the\ excitement\ of\ a\ love\ affair=
60 !Just\ as\ soon\ as\ they\ find\ you=
63 !They\ warn\ you\ and\ darn\ you=
66 : ${MSGFILTER=msgfilter}
68 ${MSGFILTER} --properties-input --properties-output -i mfi-test3.properties -o mfi-test3.out fold -b -s -w 20
70 test $result = 0 || { exit 1; }
72 cat <<\EOF > mfi-test3.ok
75 !=Project-Id-Version\: \nBonnie Tyler\n
79 !The\ world\ is\ full\ of\ married\ men=So viele \nverheiratete M\u00e4nner
82 with\ wives\ who\ never\ understand=und ihre Frauen \nverstehen sie nicht
85 !They're\ looking\ for\ someone\ to\ share=
87 # schwer zu \u00fcbersetzen...
89 !the\ excitement\ of\ a\ love\ affair=
92 !Just\ as\ soon\ as\ they\ find\ you=
95 !They\ warn\ you\ and\ darn\ you=
99 ${DIFF} mfi-test3.ok mfi-test3.out