diff options
author | Bruno Haible <bruno@clisp.org> | 2003-02-14 15:48:48 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:09:53 +0200 |
commit | 73bc0b196dce67f68a536723b231adfcc9025718 (patch) | |
tree | fc13c41e64e422ecbf18cf045a62dab4c0e2f700 /gettext-tools/tests/plural-2 | |
parent | 7f87e813e7317099325998908e482d5624bacc6e (diff) | |
download | external_gettext-73bc0b196dce67f68a536723b231adfcc9025718.zip external_gettext-73bc0b196dce67f68a536723b231adfcc9025718.tar.gz external_gettext-73bc0b196dce67f68a536723b231adfcc9025718.tar.bz2 |
Move tests/plural-2 to gettext-tools/tests/plural-2.
Diffstat (limited to 'gettext-tools/tests/plural-2')
-rwxr-xr-x | gettext-tools/tests/plural-2 | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/gettext-tools/tests/plural-2 b/gettext-tools/tests/plural-2 new file mode 100755 index 0000000..09b7cf3 --- /dev/null +++ b/gettext-tools/tests/plural-2 @@ -0,0 +1,77 @@ +#! /bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles ll ll.po dataout" +: ${MSGFMT=msgfmt} +test -d ll || mkdir ll +test -d ll/LC_MESSAGES || mkdir ll/LC_MESSAGES + +cat <<EOF | +hu +0 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +de +n != 1 +10111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 +fr +n>1 +00111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 +gd +n==1 ? 0 : n==2 ? 1 : 2 +20122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 +lt +n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2 +20111111112222222222201111111120111111112011111111201111111120111111112011111111201111111120111111112011111111222222222220111111112011111111201111111120111111112011111111201111111120111111112011111111 +ru +n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2 +20111222222222222222201112222220111222222011122222201112222220111222222011122222201112222220111222222011122222222222222220111222222011122222201112222220111222222011122222201112222220111222222011122222 +pl +n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2 +20111222222222222222221112222222111222222211122222221112222222111222222211122222221112222222111222222211122222222222222222111222222211122222221112222222111222222211122222221112222222111222222211122222 +sl +n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3 +30122333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333012233333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 +EOF +while read lang; do + read formula + read dataok + cat > ll.po <<EOF +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=10; plural=${formula};\n" + +msgid "X" +msgid_plural "Y" +msgstr[0] "0" +msgstr[1] "1" +msgstr[2] "2" +msgstr[3] "3" +msgstr[4] "4" +msgstr[5] "5" +msgstr[6] "6" +msgstr[7] "7" +msgstr[8] "8" +msgstr[9] "9" +EOF + ${MSGFMT} -o ll/LC_MESSAGES/plural.mo ll.po || exit 1 + (for i in '' 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19; do + LANGUAGE= TEXTDOMAIN=plural TEXTDOMAINDIR=. \ + $NGETTEXT --env LC_ALL=ll X Y ${i}0 ${i}1 ${i}2 ${i}3 ${i}4 ${i}5 ${i}6 ${i}7 ${i}8 ${i}9 + done) > dataout + test "$dataok" = `cat dataout` || { + echo "Formula evaluation error for language $lang" 1>&2 + echo "plural=${formula}" 1>&2 + echo "Expected: $dataok" 1>&2 + echo "Got: "`cat dataout` 1>&2 + exit 1 + } +done + +rm -fr $tmpfiles + +exit 0 |