From d001558f4d8df1edbb2c60b6b8d764faa51902c3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 3 Nov 2003 21:10:58 +0000 Subject: Move xgettext-26 to xgettext-perl-1. --- gettext-tools/tests/xgettext-perl-1 | 328 ++++++++++++++++++++++++++++++++++++ 1 file changed, 328 insertions(+) create mode 100755 gettext-tools/tests/xgettext-perl-1 (limited to 'gettext-tools/tests/xgettext-perl-1') diff --git a/gettext-tools/tests/xgettext-perl-1 b/gettext-tools/tests/xgettext-perl-1 new file mode 100755 index 0000000..8491be4 --- /dev/null +++ b/gettext-tools/tests/xgettext-perl-1 @@ -0,0 +1,328 @@ +#!/bin/sh + +# Test of Perl support. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-test26.pl" +cat <<\EOF > xg-test26.pl +use Locale::Messages qw (textdomain bindtextdomain gettext ngettext dngettext); + +textdomain "prog"; +bindtextdomain "prog", "./"; + +s/foo/ + # stress test for string extraction /xe; + +print _"'Your command, please?', asked the waiter."; + +printf ngettext ("a piece of cake", "%d pieces of cake", $n), $n; + +printf _"%s is replaced by %s.", "FF", "EUR"; + +# Should be found. +printf dngettext prog => ("one file deleted", "%d files deleted"), $n, $n; + +# Should not be found. +printf dngettext ("prog"), ("one file created", "%d files created"), $n, $n; + +printf dngettext "prog", <{"quoted string"} +tied hash $__->{ "weird +formatting"} +PERL + +print $__ # Welcome + -> # to the + { # Republic of + 'Welcome to the Republic of Perl!' # +# Perl! +}; + +$! ? ?$__{"pattern match"}? : s # This is no delimiter. +{$__{substitution}}<$__-\>{"find me"}>; + +# No interpolation! +m'$__{secret}'; + +# Multiple here documents invoked from the same line. +print gettext < xg-test26.ok +#: xg-test26.pl:9 +msgid "'Your command, please?', asked the waiter." +msgstr "" + +#: xg-test26.pl:11 +#, perl-format +msgid "a piece of cake" +msgid_plural "%d pieces of cake" +msgstr[0] "" +msgstr[1] "" + +#: xg-test26.pl:13 +#, perl-format +msgid "%s is replaced by %s." +msgstr "" + +#: xg-test26.pl:16 +#, perl-format +msgid "one file deleted" +msgid_plural "%d files deleted" +msgstr[0] "" +msgstr[1] "" + +#: xg-test26.pl:22 +#, perl-format +msgid "Singular\n" +msgid_plural "Plural\n" +msgstr[0] "" +msgstr[1] "" + +#: xg-test26.pl:28 +msgid "Bareword" +msgstr "" + +#: xg-test26.pl:30 +msgid "quoted string" +msgstr "" + +#: xg-test26.pl:31 +msgid "" +"weird\n" +"formatting" +msgstr "" + +#: xg-test26.pl:38 +msgid "Welcome to the Republic of Perl!" +msgstr "" + +#: xg-test26.pl:42 +msgid "pattern match" +msgstr "" + +#: xg-test26.pl:43 +msgid "substitution" +msgstr "" + +#: xg-test26.pl:43 +msgid "find me" +msgstr "" + +#: xg-test26.pl:50 +msgid "First here document.\n" +msgstr "" + +#: xg-test26.pl:52 +msgid "Second here document.\n" +msgstr "" + +#: xg-test26.pl:56 +msgid "abc$def" +msgstr "" + +#: xg-test26.pl:57 +msgid "abc\\$def" +msgstr "" + +#: xg-test26.pl:60 +msgid "abc$defg" +msgstr "" + +#: xg-test26.pl:61 xg-test26.pl:62 +msgid "abc\\$defg" +msgstr "" + +#: xg-test26.pl:63 +msgid "abc\\\\$defg" +msgstr "" + +#: xg-test26.pl:66 xg-test26.pl:67 xg-test26.pl:71 xg-test26.pl:72 +#: xg-test26.pl:81 xg-test26.pl:86 +msgid "ecs\\tasy" +msgstr "" + +#: xg-test26.pl:68 xg-test26.pl:69 xg-test26.pl:73 xg-test26.pl:74 +#: xg-test26.pl:83 xg-test26.pl:88 +msgid "ecs\\\\tasy" +msgstr "" + +#: xg-test26.pl:70 xg-test26.pl:75 +msgid "ecs\\\\\\tasy" +msgstr "" + +#: xg-test26.pl:80 xg-test26.pl:85 +msgid "ecs\tasy" +msgstr "" + +#: xg-test26.pl:82 xg-test26.pl:87 +msgid "ecs\\\tasy" +msgstr "" + +#: xg-test26.pl:84 xg-test26.pl:89 +msgid "ecs\\\\\tasy" +msgstr "" + +#: xg-test26.pl:90 xg-test26.pl:95 +msgid "marihuana" +msgstr "" + +#: xg-test26.pl:91 xg-test26.pl:92 xg-test26.pl:96 xg-test26.pl:97 +msgid "mari\\huana" +msgstr "" + +#: xg-test26.pl:93 xg-test26.pl:94 xg-test26.pl:98 xg-test26.pl:99 +msgid "mari\\\\huana" +msgstr "" + +#: xg-test26.pl:102 +#, perl-brace-format +msgid "This is {only} a brace formatstring." +msgstr "" + +#: xg-test26.pl:103 +#, perl-format, perl-brace-format +msgid "This is %s {mixed}." +msgstr "" + +#: xg-test26.pl:104 +#, perl-format +msgid "This is only %c." +msgstr "" + +#: xg-test26.pl:105 +msgid "This is nothing at all." +msgstr "" + +#: xg-test26.pl:106 +msgid "And this is %l also no format at all." +msgstr "" + +#: xg-test26.pl:109 +#, no-perl-format, perl-brace-format +msgid "The function '{func}' expects '%c' here." +msgstr "" + +#: xg-test26.pl:114 xg-test26.pl:116 xg-test26.pl:118 +#, perl-format, no-perl-brace-format +msgid "Left as an %exercise to {maintainer}." +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-test26.ok xg-test26.po +result=$? + +rm -fr $tmpfiles + +exit $result -- cgit v1.1