From: Bruno Haible Date: Thu, 5 Jul 2007 00:07:55 +0000 (+0000) Subject: New tests for extraction of concatenated strings in PHP mode. X-Git-Tag: v0.17~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd5047925cc49bc88e25f19e761688d0c5a2d4c9;p=thirdparty%2Fgettext.git New tests for extraction of concatenated strings in PHP mode. --- diff --git a/gettext-tools/tests/Makefile.am b/gettext-tools/tests/Makefile.am index 6a4c5fb06..7eaf27860 100644 --- a/gettext-tools/tests/Makefile.am +++ b/gettext-tools/tests/Makefile.am @@ -84,7 +84,7 @@ TESTS = gettext-1 gettext-2 gettext-3 gettext-4 gettext-5 gettext-6 gettext-7 \ xgettext-objc-1 xgettext-objc-2 \ xgettext-perl-1 xgettext-perl-2 xgettext-perl-3 xgettext-perl-4 \ xgettext-perl-5 xgettext-perl-6 xgettext-perl-7 \ - xgettext-php-1 xgettext-php-2 xgettext-php-3 \ + xgettext-php-1 xgettext-php-2 xgettext-php-3 xgettext-php-4 \ xgettext-po-1 \ xgettext-properties-1 \ xgettext-python-1 xgettext-python-2 xgettext-python-3 \ diff --git a/gettext-tools/tests/xgettext-php-3 b/gettext-tools/tests/xgettext-php-3 index fb5fdb039..c72430e60 100755 --- a/gettext-tools/tests/xgettext-php-3 +++ b/gettext-tools/tests/xgettext-php-3 @@ -11,7 +11,7 @@ cat <<\EOF > xg-ph-3.php /* a */ /* b */ string = /* c */ /* d */ -/* e */ _( /* f */ "hello world" /* g */ ); +/* e */ _( /* f */ "hello " /* g */ . /* h */ "world" /* i */ ); ?> EOF diff --git a/gettext-tools/tests/xgettext-php-4 b/gettext-tools/tests/xgettext-php-4 new file mode 100755 index 000000000..fbbcfdc6e --- /dev/null +++ b/gettext-tools/tests/xgettext-php-4 @@ -0,0 +1,61 @@ +#!/bin/sh + +# Test PHP support: string concatenation. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-ph-4.php" +cat < xg-ph-4.php + +EOF + +tmpfiles="$tmpfiles xg-ph-4.tmp.po xg-ph-4.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location --extract-all \ + -d xg-ph-4.tmp xg-ph-4.php +test $? = 0 || { rm -fr $tmpfiles; exit 1; } +tr -d '\r' < xg-ph-4.tmp.po > xg-ph-4.po +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-ph-4.ok" +cat < xg-ph-4.ok +msgid "foobar" +msgstr "" + +msgid "hello world" +msgstr "" + +msgid "1" +msgstr "" + +msgid "2" +msgstr "" + +msgid "3" +msgstr "" + +msgid "45" +msgstr "" + +msgid "6" +msgstr "" + +msgid "789" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-ph-4.ok xg-ph-4.po +result=$? + +rm -fr $tmpfiles + +exit $result