No empty .Rs/.Re
[netbsd-mini2440.git] / gnu / dist / gettext / gettext-tools / tests / msgmerge-1
blob66eb3742ebd901bb0a61bd0791a02e8ad59ff5cb
1 #! /bin/sh
3 # Test general operation and line wrapping.
5 tmpfiles=""
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles mm-test1.in1 mm-test1.in2"
9 cat <<EOF > mm-test1.in1
10 # first
11 #. this should be discarded
12 msgid "1"
13 msgstr "1x"
14 # second
15 #: bogus:1
16 msgid "2"
17 msgstr "this is a really long msgstr "
18 "used to test the wrapping to "
19 "make sure it works after all "
20 "what is a test for if not to test things?"
21 # third
22 msgid "3"
23 msgstr "3z"
24 EOF
26 cat <<EOF > mm-test1.in2
27 #. this is the first
28 #: snark.c:345
29 msgid "1"
30 msgstr ""
31 #. this is the second
32 #: hunt.c:759
33 msgid "2"
34 msgstr ""
35 #. this is the third
36 #: boojum.c:300
37 msgid "3"
38 msgstr ""
39 EOF
41 tmpfiles="$tmpfiles mm-test1.out"
42 : ${MSGMERGE=msgmerge}
43 ${MSGMERGE} -q mm-test1.in1 mm-test1.in2 -o mm-test1.out
44 test $? = 0 || { rm -fr $tmpfiles; exit 1; }
46 tmpfiles="$tmpfiles mm-test1.ok"
47 cat << EOF > mm-test1.ok
48 # first
49 #. this is the first
50 #: snark.c:345
51 msgid "1"
52 msgstr "1x"
54 # second
55 #. this is the second
56 #: hunt.c:759
57 msgid "2"
58 msgstr ""
59 "this is a really long msgstr used to test the wrapping to make sure it works "
60 "after all what is a test for if not to test things?"
62 # third
63 #. this is the third
64 #: boojum.c:300
65 msgid "3"
66 msgstr "3z"
67 EOF
69 : ${DIFF=diff}
70 ${DIFF} mm-test1.ok mm-test1.out
71 result=$?
73 rm -fr $tmpfiles
75 exit $result