• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/timemachine/gettext-0.17/gettext-tools/tests/
1#! /bin/sh
2
3# Test that --less-than=2 removes entries which occur more than twice.
4
5tmpfiles=""
6trap 'rm -fr $tmpfiles' 1 2 3 15
7
8# one msg occurs 3 times (has to go away).
9# An unique msg in in3 has to stay.
10
11tmpfiles="$tmpfiles mcomm-test13.in1 mcomm-test13.in2 mcomm-test13.in3"
12cat <<EOF > mcomm-test13.in1
13msgid ""
14msgstr ""
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# occurs 3 times
25#: first.c:123
26msgid "1"
27msgstr "1x"
28EOF
29
30cat <<EOF > mcomm-test13.in2
31msgid ""
32msgstr ""
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#: hunt.c:759
43msgid "1"
44msgstr ""
45EOF
46
47cat <<EOF > mcomm-test13.in3
48msgid ""
49msgstr ""
50"Project-Id-Version: GNU one 1.2.3\n"
51"POT-Creation-Date: 2000-12-11 20:49+0100\n"
52"PO-Revision-Date: 2000-03-18 15:25+01:00\n"
53"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
54"Language-Team: German <de@li.org>\n"
55"MIME-Version: 1.0\n"
56"Content-Type: text/plain; charset=iso-8859-1\n"
57"Content-Transfer-Encoding: 8bit\n"
58
59#: hunt.c:789
60msgid "1"
61msgstr ""
62
63# unique
64#: hunt.c:890
65msgid "2"
66msgstr ""
67EOF
68
69tmpfiles="$tmpfiles mcomm-test13.tmp mcomm-test13.out"
70: ${MSGCOMM=msgcomm}
71
72# --unique is shorthand for --less-than=2; do we've to test both
73# switches?  Are 'for' loops allowed? -ke-
74${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test13.tmp \
75    mcomm-test13.in1 mcomm-test13.in2 mcomm-test13.in3
76test $? = 0 || { rm -fr $tmpfiles; exit 1; }
77tr -d '\r' < mcomm-test13.tmp > mcomm-test13.out
78test $? = 0 || { rm -fr $tmpfiles; exit 1; }
79
80tmpfiles="$tmpfiles mcomm-test13.ok"
81cat << EOF > mcomm-test13.ok
82msgid ""
83msgstr ""
84"Project-Id-Version: GNU one 1.2.3\n"
85"POT-Creation-Date: 2000-12-11 20:49+0100\n"
86"PO-Revision-Date: 2000-03-18 15:25+01:00\n"
87"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
88"Language-Team: German <de@li.org>\n"
89"MIME-Version: 1.0\n"
90"Content-Type: text/plain; charset=iso-8859-1\n"
91"Content-Transfer-Encoding: 8bit\n"
92
93# unique
94msgid "2"
95msgstr ""
96EOF
97
98: ${DIFF=diff}
99${DIFF} mcomm-test13.ok mcomm-test13.out
100result=$?
101
102rm -fr $tmpfiles
103
104exit $result
105