Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgmerge-1
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test general operation and line wrapping.
5
6 cat <<EOF > mm-test1.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-test1.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} -q -o mm-test1.tmp mm-test1.in1 mm-test1.in2 || exit 1
40 LC_ALL=C tr -d '\r' < mm-test1.tmp > mm-test1.out || exit 1
41
42 cat << EOF > mm-test1.ok
43 # first
44 #. this is the first
45 #: snark.c:345
46 msgid "1"
47 msgstr "1x"
48
49 # second
50 #. this is the second
51 #: hunt.c:759
52 msgid "2"
53 msgstr ""
54 "this is a really long msgstr used to test the wrapping to make sure it works "
55 "after all what is a test for if not to test things?"
56
57 # third
58 #. this is the third
59 #: boojum.c:300
60 msgid "3"
61 msgstr "3z"
62 EOF
63
64 : ${DIFF=diff}
65 ${DIFF} mm-test1.ok mm-test1.out
66 result=$?
67
68 exit $result