From: Bruno Haible Date: Mon, 22 Oct 2001 11:47:51 +0000 (+0000) Subject: New tests for Java and plural. X-Git-Tag: v0.11~433 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=134965ab0670ccc5b4c2becdf76a6d3ea070dd4b;p=thirdparty%2Fgettext.git New tests for Java and plural. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index a0b9e966d..d37b409a5 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,12 @@ +2001-10-22 Bruno Haible + + * Makefile.am (TESTS): Add xgettext-15, xgettext-16. + +2001-10-04 Tommy Johansson + + * xgettext-15: New file. + * xgettext-16: New file. + 2001-09-20 Bruno Haible * format-c-1: Fix two tests to really test something. diff --git a/tests/Makefile.am b/tests/Makefile.am index c261cf600..a14ca5883 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -33,7 +33,7 @@ TESTS = gettext-1 gettext-2 \ msguniq-1 msguniq-2 msguniq-3 \ xgettext-1 xgettext-2 xgettext-3 xgettext-4 xgettext-5 xgettext-6 \ xgettext-7 xgettext-8 xgettext-9 xgettext-10 xgettext-11 xgettext-12 \ - xgettext-13 xgettext-14 \ + xgettext-13 xgettext-14 xgettext-15 xgettext-16 \ format-c-1 format-c-2 \ format-java-1 format-java-2 \ format-lisp-1 format-lisp-2 \ diff --git a/tests/xgettext-15 b/tests/xgettext-15 new file mode 100755 index 000000000..1cc08193b --- /dev/null +++ b/tests/xgettext-15 @@ -0,0 +1,37 @@ +#!/bin/sh +# +# Some tests for java plural keyword support +# + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-test15.java" +cat < xg-test15.java +class TestCase { + public TestCase() { + Bundle test = Bundle.getBundle(); + test.ngettext("test 1", "plural test"); + } +} +EOF + +tmpfiles="$tmpfiles xg-test15.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header -d xg-test15 xg-test15.java + +tmpfiles="$tmpfiles xg-test15.ok" +cat < xg-test15.ok +msgid "test 1" +msgid_plural "plural test" +msgstr[0] "" +msgstr[1] "" +EOF + +: ${DIFF=diff} +${DIFF} xg-test15.ok xg-test15.po +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/xgettext-16 b/tests/xgettext-16 new file mode 100755 index 000000000..b27e1a35b --- /dev/null +++ b/tests/xgettext-16 @@ -0,0 +1,37 @@ +#!/bin/sh +# +# Some tests for java plural keyword support +# + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-test16.java" +cat < xg-test16.java +class TestCase { + public TestCase() { + Bundle test = Bundle.getBundle(); + test.ngettext(test, "test 1", "plural test"); + } +} +EOF + +tmpfiles="$tmpfiles xg-test16.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --keyword=ngettext:2,3 -d xg-test16 xg-test16.java + +tmpfiles="$tmpfiles xg-test16.ok" +cat < xg-test16.ok +msgid "test 1" +msgid_plural "plural test" +msgstr[0] "" +msgstr[1] "" +EOF + +: ${DIFF=diff} +${DIFF} xg-test16.ok xg-test16.po +result=$? + +rm -fr $tmpfiles + +exit $result