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