3 # Test msgfilter on a PO file with contexts.
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 sed programs (Solaris etc.) omit the last line if it ended without
21 # a newline. We must skip this test when we encounter such a broken sed.
22 sedoutput=`echo $ac_n "abc$ac_c" | sed -e s/x/x/`
23 test -n "$sedoutput" || {
24 echo "Skipping test: sed program is broken"
25 rm -fr $tmpfiles; exit 77
28 # Some sed programs (IRIX, OSF/1 etc.) add a newline to the last line if it
29 # doesn't end with a newline.
30 sedoutputcount=`echo $ac_n "abc$ac_c" | sed -e s/x/x/ | wc -c`
31 sedoutputcount=`echo "$sedoutputcount" | sed -e 's/[ ]//g'`
32 test "$sedoutputcount" = 3 || {
33 echo "Skipping test: sed program inserts extra newline"
34 rm -fr $tmpfiles; exit 77
37 tmpfiles="$tmpfiles mfi-test4.po"
38 cat <<\EOF > mfi-test4.po
41 "Content-Type: text/plain; charset=UTF-8\n"
42 "Content-Transfer-Encoding: 8bit\n"
54 #. Denote a lock's state
59 #. Denote a lock's state
75 #~ msgstr "Enregistrer l'as"
80 #~ msgstr "Enregistrer sous"
83 tmpfiles="$tmpfiles mfi-test4.out mfi-test4.err"
84 : ${MSGFILTER=msgfilter}
92 ${MSGFILTER} -i mfi-test4.po -o mfi-test4.out sed -e "$sedexpr1" -e "$sedexpr2" >mfi-test4.err 2>&1
94 cat mfi-test4.err | grep -v 'warning: Locale charset' | grep -v '^ '
95 test $result = 0 || { rm -fr $tmpfiles; exit 1; }
97 tmpfiles="$tmpfiles mfi-test4.ok"
98 cat <<\EOF > mfi-test4.ok
101 "[[Content-Type: text/plain; charset=UTF-8\n"
102 "Content-Transfer-Encoding: 8bit]]\n"
114 #. Denote a lock's state
119 #. Denote a lock's state
132 msgstr "[[photocopieur]]"
135 #~ msgstr "[[Enregistrer l'as]]"
140 #~ msgstr "[[Enregistrer sous]]"
144 ${DIFF} mfi-test4.ok mfi-test4.out