No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / msgmerge-3
blob4ca85c2c4f9cb4fe2cb961fcf8a4e04f6df784e9
1 #! /bin/sh
3 # Test handling of obsolete/untranslated messages.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles mm-test3.in1 mm-test3.in2"
9 cat <<EOF > mm-test3.in1
11 # def.po
13 #: file:100
14 msgid ""
15 "not existing"
16 msgstr "but with translation"
18 #: file2:101
19 msgid "not existing without translation"
20 msgstr ""
22 #: file3:102
23 msgid "still existing"
24 msgstr "translation"
26 #: should-not-be-here:10
27 #~ msgid "former obsolete"
28 #~ msgstr ""
29 #~ "but again useful"
31 #~ msgid "this stays obsolete"
32 #~ msgstr "even after running msgmerge"
35 # trailing comments should be removed
36 EOF
38 cat <<EOF > mm-test3.in2
40 # ref.po
42 #: file3:102
43 msgid "still existing"
44 msgstr "here is normally no comment"
46 #: file4:10
47 msgid ""
48 "former obsolete"
49 msgstr ""
52 # trailing comments should be removed, even here
53 EOF
55 tmpfiles="$tmpfiles mm-test3.out"
56 : ${MSGMERGE=msgmerge}
57 ${MSGMERGE} -q mm-test3.in1 mm-test3.in2 -o mm-test3.out
58 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
60 tmpfiles="$tmpfiles mm-test3.ok"
61 cat << EOF > mm-test3.ok
62 #: file3:102
63 msgid "still existing"
64 msgstr "translation"
66 #: file4:10
67 msgid "former obsolete"
68 msgstr "but again useful"
71 # def.po
73 #~ msgid "not existing"
74 #~ msgstr "but with translation"
76 #~ msgid "this stays obsolete"
77 #~ msgstr "even after running msgmerge"
78 EOF
80 : ${DIFF=diff}
81 ${DIFF} mm-test3.ok mm-test3.out
82 result=$?
84 rm -fr $tmpfiles
86 exit $result