Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgcomm-15
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test that without --force-po option, a PO file without translations is
5 # not created.
6
7 # no unique msg in input files.
8 # with --force-po create an empty PO file; cf. msgcomm-14
9
10 cat <<EOF > mcomm-test15.in1
11 msgid ""
12 msgstr ""
13 "Project-Id-Version: GNU one 1.2.3\n"
14 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
15 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
16 "Last-Translator: Karl Eichwalder <ke@suse.de>\n"
17 "Language-Team: German <de@li.org>\n"
18 "MIME-Version: 1.0\n"
19 "Content-Type: text/plain; charset=iso-8859-1\n"
20 "Content-Transfer-Encoding: 8bit\n"
21
22 # occurs 3 times
23 #: first.c:123
24 msgid "1"
25 msgstr "1x"
26 EOF
27
28 cat <<EOF > mcomm-test15.in2
29 msgid ""
30 msgstr ""
31 "Project-Id-Version: GNU one 1.2.3\n"
32 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
33 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
34 "Last-Translator: Karl Eichwalder <ke@suse.de>\n"
35 "Language-Team: German <de@li.org>\n"
36 "MIME-Version: 1.0\n"
37 "Content-Type: text/plain; charset=iso-8859-1\n"
38 "Content-Transfer-Encoding: 8bit\n"
39
40 #: hunt.c:759
41 msgid "1"
42 msgstr ""
43 EOF
44
45 cat <<EOF > mcomm-test15.in3
46 msgid ""
47 msgstr ""
48 "Project-Id-Version: GNU one 1.2.3\n"
49 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
50 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
51 "Last-Translator: Karl Eichwalder <ke@suse.de>\n"
52 "Language-Team: German <de@li.org>\n"
53 "MIME-Version: 1.0\n"
54 "Content-Type: text/plain; charset=iso-8859-1\n"
55 "Content-Transfer-Encoding: 8bit\n"
56
57 #: hunt.c:789
58 msgid "1"
59 msgstr ""
60 EOF
61
62 rm -f mcomm-test15.out
63
64 : ${MSGCOMM=msgcomm}
65
66 # --unique is shorthand for --less-than=2; do we've to test both
67 # switches?  Are 'for' loops allowed? -ke-
68 ${MSGCOMM} --less-than=2 --no-location -o mcomm-test15.out \
69     mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3 || exit 1
70
71 # we've no unique msg; thus no PO should be created.
72 if test -f mcomm-test15.out; then
73   echo "mcomm-test15.out wrongly written."
74   result=1
75 else
76   result=0
77 fi
78
79 exit $result