Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-3
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test handling of obsolete/untranslated messages.
5
6 cat <<EOF > mm-test3.in1
7 #
8 # def.po
9 #
10 #: file:100
11 msgid ""
12 "not existing"
13 msgstr "but with translation"
14
15 #: file2:101
16 msgid "not existing without translation"
17 msgstr ""
18
19 #: file3:102
20 msgid "still existing"
21 msgstr "translation"
22
23 #: should-not-be-here:10
24 #~ msgid "former obsolete"
25 #~ msgstr ""
26 #~ "but again useful"
27
28 #~ msgid "this stays obsolete"
29 #~ msgstr "even after running msgmerge"
30
31 #
32 # trailing comments should be removed
33 EOF
34
35 cat <<EOF > mm-test3.in2
36 #
37 # ref.po
38 #
39 #: file3:102
40 msgid "still existing"
41 msgstr "here is normally no comment"
42
43 #: file4:10
44 msgid ""
45 "former obsolete"
46 msgstr ""
47
48 #
49 # trailing comments should be removed, even here
50 EOF
51
52 : ${MSGMERGE=msgmerge}
53 ${MSGMERGE} -q -o mm-test3.tmp mm-test3.in1 mm-test3.in2 || exit 1
54 LC_ALL=C tr -d '\r' < mm-test3.tmp > mm-test3.out || exit 1
55
56 cat << EOF > mm-test3.ok
57 #: file3:102
58 msgid "still existing"
59 msgstr "translation"
60
61 #: file4:10
62 msgid "former obsolete"
63 msgstr "but again useful"
64
65 #
66 # def.po
67 #
68 #~ msgid "not existing"
69 #~ msgstr "but with translation"
70
71 #~ msgid "this stays obsolete"
72 #~ msgstr "even after running msgmerge"
73 EOF
74
75 : ${DIFF=diff}
76 ${DIFF} mm-test3.ok mm-test3.out
77 result=$?
78
79 exit $result