Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-25
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test --add-location=file option.
5
6 cat <<EOF > mm-test25.in1
7 # first
8 #. this should be discarded
9 msgid "1"
10 msgstr "1x"
11 # second
12 #: bogus:1
13 msgid "2"
14 msgstr  "this is a really long msgstr "
15         "used to test the wrapping to "
16         "make sure it works after all "
17         "what is a test for if not to test things?"
18 # third
19 msgid "3"
20 msgstr "3z"
21 EOF
22
23 cat <<EOF > mm-test25.in2
24 #. this is the first
25 #: snark.c:345
26 msgid "1"
27 msgstr ""
28 #. this is the second
29 #: hunt.c:759
30 msgid "2"
31 msgstr ""
32 #. this is the third
33 #: boojum.c:300
34 msgid "3"
35 msgstr ""
36 EOF
37
38 : ${MSGMERGE=msgmerge}
39 ${MSGMERGE} --add-location=file -q -o mm-test25.tmp mm-test25.in1 mm-test25.in2 \
40     || exit 1
41 LC_ALL=C tr -d '\r' < mm-test25.tmp > mm-test25.out || exit 1
42
43 cat << EOF > mm-test25.ok
44 # first
45 #. this is the first
46 #: snark.c
47 msgid "1"
48 msgstr "1x"
49
50 # second
51 #. this is the second
52 #: hunt.c
53 msgid "2"
54 msgstr ""
55 "this is a really long msgstr used to test the wrapping to make sure it works "
56 "after all what is a test for if not to test things?"
57
58 # third
59 #. this is the third
60 #: boojum.c
61 msgid "3"
62 msgstr "3z"
63 EOF
64
65 : ${DIFF=diff}
66 ${DIFF} mm-test25.ok mm-test25.out
67 result=$?
68
69 exit $result