2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test msgfilter on a PO file with contexts.
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 sed programs (Solaris etc.) omit the last line if it ended without
19 # a newline. We must skip this test when we encounter such a broken sed.
20 sedoutput=`echo $ac_n "abc$ac_c" | sed -e s/x/x/`
21 test -n "$sedoutput" || {
22 echo "Skipping test: sed program is broken"
26 # Some sed programs (IRIX, OSF/1 etc.) add a newline to the last line if it
27 # doesn't end with a newline.
28 sedoutputcount=`echo $ac_n "abc$ac_c" | sed -e s/x/x/ | wc -c`
29 sedoutputcount=`echo "$sedoutputcount" | sed -e 's/[ ]//g'`
30 test "$sedoutputcount" = 3 || {
31 echo "Skipping test: sed program inserts extra newline"
35 cat <<\EOF > mfi-test4.po
38 "Content-Type: text/plain; charset=UTF-8\n"
39 "Content-Transfer-Encoding: 8bit\n"
51 #. Denote a lock's state
56 #. Denote a lock's state
72 #~ msgstr "Enregistrer l'as"
77 #~ msgstr "Enregistrer sous"
80 : ${MSGFILTER=msgfilter}
88 ${MSGFILTER} -i mfi-test4.po -o mfi-test4.out sed -e "$sedexpr1" -e "$sedexpr2" >mfi-test4.err 2>&1
90 cat mfi-test4.err | grep -v 'warning: Locale charset' | grep -v '^ '
91 test $result = 0 || { exit 1; }
93 cat <<\EOF > mfi-test4.ok
96 "[[Content-Type: text/plain; charset=UTF-8\n"
97 "Content-Transfer-Encoding: 8bit]]\n"
109 #. Denote a lock's state
114 #. Denote a lock's state
127 msgstr "[[photocopieur]]"
130 #~ msgstr "[[Enregistrer l'as]]"
135 #~ msgstr "[[Enregistrer sous]]"
139 ${DIFF} mfi-test4.ok mfi-test4.out