Home | History | Annotate | Line # | Download | only in tests
      1  1.1  christos #! /bin/sh
      2  1.1  christos 
      3  1.1  christos # Test handling of obsolete/untranslated messages with Java .properties syntax.
      4  1.1  christos 
      5  1.1  christos tmpfiles=""
      6  1.1  christos trap 'rm -fr $tmpfiles' 1 2 3 15
      7  1.1  christos 
      8  1.1  christos tmpfiles="$tmpfiles mm-p-1.in1 mm-p-1.in2"
      9  1.1  christos cat <<EOF > mm-p-1.in1
     10  1.1  christos #
     11  1.1  christos # def.po
     12  1.1  christos #
     13  1.1  christos #: file:100
     14  1.1  christos not\ existing=but with translation
     15  1.1  christos 
     16  1.1  christos #: file2:101
     17  1.1  christos !not\ existing\ without\ translation=
     18  1.1  christos 
     19  1.1  christos #: file3:102
     20  1.1  christos still\ existing=translation
     21  1.1  christos 
     22  1.1  christos #
     23  1.1  christos # trailing comments should be removed
     24  1.1  christos EOF
     25  1.1  christos 
     26  1.1  christos cat <<EOF > mm-p-1.in2
     27  1.1  christos #
     28  1.1  christos # ref.po
     29  1.1  christos #
     30  1.1  christos #: file3:102
     31  1.1  christos still\ existing=here is normally no comment
     32  1.1  christos 
     33  1.1  christos #: file4:10
     34  1.1  christos !untranslated=
     35  1.1  christos 
     36  1.1  christos #
     37  1.1  christos # trailing comments should be removed, even here
     38  1.1  christos EOF
     39  1.1  christos 
     40  1.1  christos tmpfiles="$tmpfiles mm-p-1.out"
     41  1.1  christos : ${MSGMERGE=msgmerge}
     42  1.1  christos ${MSGMERGE} -q --properties-input --properties-output -o mm-p-1.out mm-p-1.in1 mm-p-1.in2
     43  1.1  christos test $? = 0 || { rm -fr $tmpfiles; exit 1; }
     44  1.1  christos 
     45  1.1  christos tmpfiles="$tmpfiles mm-p-1.ok"
     46  1.1  christos cat << EOF > mm-p-1.ok
     47  1.1  christos #: file3:102
     48  1.1  christos still\ existing=translation
     49  1.1  christos 
     50  1.1  christos #: file4:10
     51  1.1  christos !untranslated=
     52  1.1  christos EOF
     53  1.1  christos 
     54  1.1  christos : ${DIFF=diff}
     55  1.1  christos ${DIFF} mm-p-1.ok mm-p-1.out
     56  1.1  christos result=$?
     57  1.1  christos 
     58  1.1  christos rm -fr $tmpfiles
     59  1.1  christos 
     60  1.1  christos exit $result
     61