Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-compendium-3
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test compendium option.
5
6 # Translation is available within the compendium (mm-c-3.com)
7 # the old translation file (mm-c-3.in1) contains the same msgid
8 # Why not make use of the translation from the compendium?
9
10 cat <<EOF > mm-c-3.in1
11 #: file.c:123
12 msgid "1"
13 msgstr "1x"
14
15 #: file.c:345
16 msgid "one, two, three"
17 msgstr ""
18 EOF
19
20 cat <<EOF > mm-c-3.com
21 #: file.c:345
22 msgid "one, two, three"
23 msgstr "1, 2, 3"
24 EOF
25
26 cat <<EOF > mm-c-3.pot
27 #: file.c:123
28 msgid "1"
29 msgstr ""
30
31 #: file.c:345
32 msgid "one, two, three"
33 msgstr ""
34 EOF
35
36 : ${MSGMERGE=msgmerge}
37 ${MSGMERGE} -q -C mm-c-3.com -o mm-c-3.tmp mm-c-3.in1 mm-c-3.pot || exit 1
38 LC_ALL=C tr -d '\r' < mm-c-3.tmp > mm-c-3.out || exit 1
39
40 cat << EOF > mm-c-3.ok
41 #: file.c:123
42 msgid "1"
43 msgstr "1x"
44
45 #: file.c:345
46 msgid "one, two, three"
47 msgstr "1, 2, 3"
48 EOF
49
50 : ${DIFF=diff}
51 ${DIFF} mm-c-3.ok mm-c-3.out
52 result=$?
53
54 exit $result