xref: /netbsd-src/external/gpl2/gettext/dist/gettext-tools/tests/msgfmt-15 (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
1*946379e7Schristos#! /bin/sh
2*946379e7Schristos
3*946379e7Schristos# Test plural formula dependent checking of format strings.
4*946379e7Schristos
5*946379e7Schristostmpfiles=""
6*946379e7Schristostrap 'rm -fr $tmpfiles' 1 2 3 15
7*946379e7Schristos
8*946379e7Schristos# Take as example a plural formula which takes the values 0 and 2 infinitely
9*946379e7Schristos# often, and value 1 only a few times.
10*946379e7Schristos# Test: 1 - have %d everywhere - OK
11*946379e7Schristos#       2 - lack %d for value 0 - error
12*946379e7Schristos#       3 - lack %d for value 1 - OK
13*946379e7Schristos#       4 - lack %d for value 2 - error
14*946379e7Schristos
15*946379e7Schristostmpfiles="$tmpfiles mf-15.po1"
16*946379e7Schristoscat <<\EOF > mf-15.po1
17*946379e7Schristos# SOME DESCRIPTIVE TITLE.
18*946379e7Schristos# Copyright (C) YEAR Free Software Foundation, Inc.
19*946379e7Schristos# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
20*946379e7Schristos#
21*946379e7Schristosmsgid ""
22*946379e7Schristosmsgstr ""
23*946379e7Schristos"Project-Id-Version: GNU bison\n"
24*946379e7Schristos"PO-Revision-Date: 2001-04-05 19:47+0200\n"
25*946379e7Schristos"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
26*946379e7Schristos"Language-Team: test <test@li.org>\n"
27*946379e7Schristos"MIME-Version: 1.0\n"
28*946379e7Schristos"Content-Type: text/plain; charset=UTF-8\n"
29*946379e7Schristos"Content-Transfer-Encoding: 8bit\n"
30*946379e7Schristos"Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n"
31*946379e7Schristos
32*946379e7Schristos#: src/reduce.c:511
33*946379e7Schristos#, c-format
34*946379e7Schristosmsgid "%d useless nonterminal"
35*946379e7Schristosmsgid_plural "%d useless nonterminals"
36*946379e7Schristosmsgstr[0] "%d unnütze Nichtterminale"
37*946379e7Schristosmsgstr[1] "%d unnützes Nichtterminal"
38*946379e7Schristosmsgstr[2] "%d der unnützen Nichtterminale"
39*946379e7SchristosEOF
40*946379e7Schristos
41*946379e7Schristos: ${MSGFMT=msgfmt}
42*946379e7Schristos${MSGFMT} --check -o /dev/null mf-15.po1
43*946379e7Schristostest $? = 0 || { rm -fr $tmpfiles; exit 1; }
44*946379e7Schristos
45*946379e7Schristostmpfiles="$tmpfiles mf-15.po2"
46*946379e7Schristoscat <<\EOF > mf-15.po2
47*946379e7Schristos# SOME DESCRIPTIVE TITLE.
48*946379e7Schristos# Copyright (C) YEAR Free Software Foundation, Inc.
49*946379e7Schristos# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
50*946379e7Schristos#
51*946379e7Schristosmsgid ""
52*946379e7Schristosmsgstr ""
53*946379e7Schristos"Project-Id-Version: GNU bison\n"
54*946379e7Schristos"PO-Revision-Date: 2001-04-05 19:47+0200\n"
55*946379e7Schristos"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
56*946379e7Schristos"Language-Team: test <test@li.org>\n"
57*946379e7Schristos"MIME-Version: 1.0\n"
58*946379e7Schristos"Content-Type: text/plain; charset=UTF-8\n"
59*946379e7Schristos"Content-Transfer-Encoding: 8bit\n"
60*946379e7Schristos"Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n"
61*946379e7Schristos
62*946379e7Schristos#: src/reduce.c:511
63*946379e7Schristos#, c-format
64*946379e7Schristosmsgid "%d useless nonterminal"
65*946379e7Schristosmsgid_plural "%d useless nonterminals"
66*946379e7Schristosmsgstr[0] "unnütze Nichtterminale"
67*946379e7Schristosmsgstr[1] "%d unnützes Nichtterminal"
68*946379e7Schristosmsgstr[2] "%d der unnützen Nichtterminale"
69*946379e7SchristosEOF
70*946379e7Schristos
71*946379e7Schristos: ${MSGFMT=msgfmt}
72*946379e7Schristos${MSGFMT} --check -o /dev/null mf-15.po2 2>/dev/null
73*946379e7Schristostest $? = 1 || { rm -fr $tmpfiles; exit 1; }
74*946379e7Schristos
75*946379e7Schristostmpfiles="$tmpfiles mf-15.po3"
76*946379e7Schristoscat <<\EOF > mf-15.po3
77*946379e7Schristos# SOME DESCRIPTIVE TITLE.
78*946379e7Schristos# Copyright (C) YEAR Free Software Foundation, Inc.
79*946379e7Schristos# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
80*946379e7Schristos#
81*946379e7Schristosmsgid ""
82*946379e7Schristosmsgstr ""
83*946379e7Schristos"Project-Id-Version: GNU bison\n"
84*946379e7Schristos"PO-Revision-Date: 2001-04-05 19:47+0200\n"
85*946379e7Schristos"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
86*946379e7Schristos"Language-Team: test <test@li.org>\n"
87*946379e7Schristos"MIME-Version: 1.0\n"
88*946379e7Schristos"Content-Type: text/plain; charset=UTF-8\n"
89*946379e7Schristos"Content-Transfer-Encoding: 8bit\n"
90*946379e7Schristos"Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n"
91*946379e7Schristos
92*946379e7Schristos#: src/reduce.c:511
93*946379e7Schristos#, c-format
94*946379e7Schristosmsgid "%d useless nonterminal"
95*946379e7Schristosmsgid_plural "%d useless nonterminals"
96*946379e7Schristosmsgstr[0] "%d unnütze Nichtterminale"
97*946379e7Schristosmsgstr[1] "unnützes Nichtterminal"
98*946379e7Schristosmsgstr[2] "%d der unnützen Nichtterminale"
99*946379e7SchristosEOF
100*946379e7Schristos
101*946379e7Schristos: ${MSGFMT=msgfmt}
102*946379e7Schristos${MSGFMT} --check -o /dev/null mf-15.po3
103*946379e7Schristostest $? = 0 || { rm -fr $tmpfiles; exit 1; }
104*946379e7Schristos
105*946379e7Schristostmpfiles="$tmpfiles mf-15.po4"
106*946379e7Schristoscat <<\EOF > mf-15.po4
107*946379e7Schristos# SOME DESCRIPTIVE TITLE.
108*946379e7Schristos# Copyright (C) YEAR Free Software Foundation, Inc.
109*946379e7Schristos# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
110*946379e7Schristos#
111*946379e7Schristosmsgid ""
112*946379e7Schristosmsgstr ""
113*946379e7Schristos"Project-Id-Version: GNU bison\n"
114*946379e7Schristos"PO-Revision-Date: 2001-04-05 19:47+0200\n"
115*946379e7Schristos"Last-Translator: ABC DEF <abc@gnu.uucp>\n"
116*946379e7Schristos"Language-Team: test <test@li.org>\n"
117*946379e7Schristos"MIME-Version: 1.0\n"
118*946379e7Schristos"Content-Type: text/plain; charset=UTF-8\n"
119*946379e7Schristos"Content-Transfer-Encoding: 8bit\n"
120*946379e7Schristos"Plural-Forms: nplurals=3; plural=(n <= 1 ? 1 : (n % 2) == 0 ? 2 : 0);\n"
121*946379e7Schristos
122*946379e7Schristos#: src/reduce.c:511
123*946379e7Schristos#, c-format
124*946379e7Schristosmsgid "%d useless nonterminal"
125*946379e7Schristosmsgid_plural "%d useless nonterminals"
126*946379e7Schristosmsgstr[0] "%d unnütze Nichtterminale"
127*946379e7Schristosmsgstr[1] "%d unnützes Nichtterminal"
128*946379e7Schristosmsgstr[2] "der unnützen Nichtterminale"
129*946379e7SchristosEOF
130*946379e7Schristos
131*946379e7Schristos: ${MSGFMT=msgfmt}
132*946379e7Schristos${MSGFMT} --check -o /dev/null mf-15.po4 2>/dev/null
133*946379e7Schristostest $? = 1 || { rm -fr $tmpfiles; exit 1; }
134*946379e7Schristos
135*946379e7Schristosrm -fr $tmpfiles
136*946379e7Schristos
137*946379e7Schristosexit $result
138