Home | History | Annotate | Line # | Download | only in tests
      1 #! /bin/sh
      2 
      3 # Test --update: location changed, and xgettext comment added. Both changes
      4 # must be reflected in the resulting PO file. With Java .properties syntax.
      5 
      6 tmpfiles=""
      7 trap 'rm -fr $tmpfiles' 1 2 3 15
      8 
      9 tmpfiles="$tmpfiles mm-p-2.po"
     10 cat <<\EOF > mm-p-2.po
     11 #: cogarithmetic.cc:12
     12 white=wei\u00df
     13 EOF
     14 
     15 tmpfiles="$tmpfiles mm-p-2.pot"
     16 cat <<EOF > mm-p-2.pot
     17 #. location changed
     18 #: cogarithmetic.cc:33
     19 !white=
     20 EOF
     21 
     22 tmpfiles="$tmpfiles mm-p-2.po~"
     23 : ${MSGMERGE=msgmerge}
     24 ${MSGMERGE} -q --properties-input --update mm-p-2.po mm-p-2.pot
     25 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     26 
     27 tmpfiles="$tmpfiles mm-p-2.ok"
     28 cat <<\EOF > mm-p-2.ok
     29 #. location changed
     30 #: cogarithmetic.cc:33
     31 white=wei\u00df
     32 EOF
     33 
     34 : ${DIFF=diff}
     35 ${DIFF} mm-p-2.ok mm-p-2.po
     36 result=$?
     37 
     38 rm -fr $tmpfiles
     39 
     40 exit $result
     41