diff options
author | Bruno Haible <bruno@clisp.org> | 2003-02-14 15:40:34 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:09:50 +0200 |
commit | 89525167dfb6ca56df9c882783671ec4a0a0b95b (patch) | |
tree | 31564d2a6b7edab4564ed83b53f5fdb09f29865e /gettext-tools/tests | |
parent | ee9ddba4e36d221e1631760f29b149bfc2452bf1 (diff) | |
download | external_gettext-89525167dfb6ca56df9c882783671ec4a0a0b95b.zip external_gettext-89525167dfb6ca56df9c882783671ec4a0a0b95b.tar.gz external_gettext-89525167dfb6ca56df9c882783671ec4a0a0b95b.tar.bz2 |
Move tests/msgfmt-10 to gettext-tools/tests/msgfmt-10.
Diffstat (limited to 'gettext-tools/tests')
-rwxr-xr-x | gettext-tools/tests/msgfmt-10 | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/gettext-tools/tests/msgfmt-10 b/gettext-tools/tests/msgfmt-10 new file mode 100755 index 0000000..fad6c17 --- /dev/null +++ b/gettext-tools/tests/msgfmt-10 @@ -0,0 +1,87 @@ +#! /bin/sh + +# Test format string checking in plural entries. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles mf-test10.po1" +cat <<\EOF > mf-test10.po1 +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU bison\n" +"PO-Revision-Date: 2001-04-05 19:47+0200\n" +"Last-Translator: ABC DEF <abc@gnu.uucp>\n" +"Language-Team: test <test@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-9\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/reduce.c:511 +#, c-format +msgid "%d useless nonterminal" +msgid_plural "%d useless nonterminals" +msgstr[0] "1 yarars�z de�i�ken simge" +msgstr[1] "%d yarars�z de�i�ken simges" + +#: src/reduce.c:520 +#, c-format +msgid "one useless rule" +msgid_plural "%d useless rules" +msgstr[0] "%d yarars�z kural" +msgstr[1] "%d yarars�z kurals" +EOF + +: ${MSGFMT=msgfmt} +${MSGFMT} --check mf-test10.po1 -o /dev/null +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles mf-test10.po2" +cat <<\EOF > mf-test10.po2 +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: GNU bison\n" +"PO-Revision-Date: 2001-04-05 19:47+0200\n" +"Last-Translator: ABC DEF <abc@gnu.uucp>\n" +"Language-Team: test <test@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-9\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: src/reduce.c:520 +#, c-format +msgid "one useless rule" +msgid_plural "%d useless rules" +msgstr[0] "%d yarars�z kural" +msgstr[1] "%d yarars�z kural%s" +EOF + +tmpfiles="$tmpfiles mf-test10.err" +: ${MSGFMT=msgfmt} +LC_MESSAGES=C LC_ALL= \ +${MSGFMT} --check mf-test10.po2 -o /dev/null \ + 2>&1 | grep -v '^==' > mf-test10.err + +tmpfiles="$tmpfiles mf-test10.ok" +cat << EOF > mf-test10.ok +mf-test10.po2:18: number of format specifications in 'msgid' and 'msgstr[1]' does not match +msgfmt: found 1 fatal error +EOF + +: ${DIFF=diff} +${DIFF} mf-test10.ok mf-test10.err +result=$? + +rm -fr $tmpfiles + +exit $result |