Imported Upstream version 0.19.7
[platform/upstream/gettext.git] / gettext-tools / tests / msgcomm-12
1 #! /bin/sh
2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4 # Test that --less-than=2 removes entries which occur twice and keeps entries
5 # which occur only once.
6
7 # unique msg in in3
8
9 cat <<EOF > mcomm-test12.in1
10 msgid ""
11 msgstr ""
12 "Project-Id-Version: GNU one 1.2.3\n"
13 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
14 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
15 "Last-Translator: Karl Eichwalder <ke@suse.de>\n"
16 "Language-Team: German <de@li.org>\n"
17 "MIME-Version: 1.0\n"
18 "Content-Type: text/plain; charset=iso-8859-1\n"
19 "Content-Transfer-Encoding: 8bit\n"
20
21 # duplicate (cf. in2)
22 #: first.c:123
23 msgid "1"
24 msgstr "1x"
25 EOF
26
27 cat <<EOF > mcomm-test12.in2
28 msgid ""
29 msgstr ""
30 "Project-Id-Version: GNU one 1.2.3\n"
31 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
32 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
33 "Last-Translator: Karl Eichwalder <ke@suse.de>\n"
34 "Language-Team: German <de@li.org>\n"
35 "MIME-Version: 1.0\n"
36 "Content-Type: text/plain; charset=iso-8859-1\n"
37 "Content-Transfer-Encoding: 8bit\n"
38
39 # duplicate (cf. in1)
40 #: hunt.c:759
41 msgid "1"
42 msgstr ""
43 EOF
44
45 cat <<EOF > mcomm-test12.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 # unique
58 #: hunt.c:890
59 msgid "2"
60 msgstr ""
61 EOF
62
63 : ${MSGCOMM=msgcomm}
64
65 # --unique is shorthand for --less-than=2; do we've to test both
66 # switches?  Are 'for' loops allowed? -ke-
67 ${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test12.tmp \
68     mcomm-test12.in1 mcomm-test12.in2 mcomm-test12.in3 || exit 1
69 LC_ALL=C tr -d '\r' < mcomm-test12.tmp > mcomm-test12.out || exit 1
70
71 cat << EOF > mcomm-test12.ok
72 msgid ""
73 msgstr ""
74 "Project-Id-Version: GNU one 1.2.3\n"
75 "POT-Creation-Date: 2000-12-11 20:49+0100\n"
76 "PO-Revision-Date: 2000-03-18 15:25+01:00\n"
77 "Last-Translator: Karl Eichwalder <ke@suse.de>\n"
78 "Language-Team: German <de@li.org>\n"
79 "MIME-Version: 1.0\n"
80 "Content-Type: text/plain; charset=iso-8859-1\n"
81 "Content-Transfer-Encoding: 8bit\n"
82
83 # unique
84 msgid "2"
85 msgstr ""
86 EOF
87
88 : ${DIFF=diff}
89 ${DIFF} mcomm-test12.ok mcomm-test12.out
90 result=$?
91
92 exit $result