diff options
author | Bruno Haible <bruno@clisp.org> | 2006-06-22 11:24:39 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2009-06-23 12:13:26 +0200 |
commit | 93882c1dbe95b7c0b30dbbf8a81cf0d8cf455220 (patch) | |
tree | 8c15d31d3037172f13402c6ed80fffe7220b34ac | |
parent | 630e9b244ca36514940c22f5b749342308e39873 (diff) | |
download | external_gettext-93882c1dbe95b7c0b30dbbf8a81cf0d8cf455220.zip external_gettext-93882c1dbe95b7c0b30dbbf8a81cf0d8cf455220.tar.gz external_gettext-93882c1dbe95b7c0b30dbbf8a81cf0d8cf455220.tar.bz2 |
Test of bash $(...) syntax.
-rwxr-xr-x | gettext-tools/tests/xgettext-sh-5 | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/gettext-tools/tests/xgettext-sh-5 b/gettext-tools/tests/xgettext-sh-5 new file mode 100755 index 0000000..de5c954 --- /dev/null +++ b/gettext-tools/tests/xgettext-sh-5 @@ -0,0 +1,58 @@ +#!/bin/sh + +# Test of Shell support: bash $(...) syntax. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="$tmpfiles xg-sh-5.sh" +cat <<\EOF > xg-sh-5.sh +echo $(gettext 'Simple string') +echo "$(gettext 'Simple string inside double-quotes')" +echo $(gettext 'Simple decorated string: "x" \"y\"') +echo "$(gettext 'Simple decorated string: "x" \"y\" inside double-quotes')" +echo $(gettext "Simple dstring") +echo "$(gettext "Simple dstring inside double-quotes")" +echo $(gettext "Simple decorated dstring: \"x\" \\\"y\\\"") +echo "$(gettext "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes")" +EOF + +tmpfiles="$tmpfiles xg-sh-5.po" +: ${XGETTEXT=xgettext} +${XGETTEXT} --omit-header --no-location -d xg-sh-5 xg-sh-5.sh +test $? = 0 || { rm -fr $tmpfiles; exit 1; } + +tmpfiles="$tmpfiles xg-sh-5.ok" +cat <<\EOF > xg-sh-5.ok +msgid "Simple string" +msgstr "" + +msgid "Simple string inside double-quotes" +msgstr "" + +msgid "Simple decorated string: \"x\" \\\"y\\\"" +msgstr "" + +msgid "Simple decorated string: \"x\" \\\"y\\\" inside double-quotes" +msgstr "" + +msgid "Simple dstring" +msgstr "" + +msgid "Simple dstring inside double-quotes" +msgstr "" + +msgid "Simple decorated dstring: \"x\" \\\"y\\\"" +msgstr "" + +msgid "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} xg-sh-5.ok xg-sh-5.po +result=$? + +rm -fr $tmpfiles + +exit $result |