1#! /bin/sh
2
3# Test handling of comments.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8tmpfiles="$tmpfiles mm-test4.in1.po mm-test4.in2.po"
9cat <<EOF > mm-test4.in1.po
10msgid "one"
11msgstr "eins"
12# This comment should be copied.
13msgid "two"
14msgstr "zwei"
15
16
17# And this one, too.
18#~ msgid "four"
19#~ msgstr "vier"
20EOF
21
22cat <<EOF > mm-test4.in2.po
23msgid "one"
24msgstr ""
25# This is a comment in the POT file.
26msgid "three"
27msgstr ""
28EOF
29
30tmpfiles="$tmpfiles mm-test4.out"
31: ${MSGMERGE=msgmerge}
32${MSGMERGE} -q -o mm-test4.out mm-test4.in1.po mm-test4.in2.po
33test $? = 0 || { rm -fr $tmpfiles; exit 1; }
34
35tmpfiles="$tmpfiles mm-test4.ok"
36cat <<EOF > mm-test4.ok
37msgid "one"
38msgstr "eins"
39
40# This is a comment in the POT file.
41msgid "three"
42msgstr ""
43
44# This comment should be copied.
45#~ msgid "two"
46#~ msgstr "zwei"
47
48# And this one, too.
49#~ msgid "four"
50#~ msgstr "vier"
51EOF
52
53: ${DIFF=diff}
54${DIFF} mm-test4.ok mm-test4.out
55result=$?
56
57rm -fr $tmpfiles
58
59exit $result
60