1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test of Shell support: bash $(...) syntax.
5
6cat <<\EOF > xg-sh-5.sh
7echo $(gettext 'Simple string')
8echo "$(gettext 'Simple string inside double-quotes')"
9echo $(gettext 'Simple decorated string: "x" \"y\"')
10echo "$(gettext 'Simple decorated string: "x" \"y\" inside double-quotes')"
11echo $(gettext "Simple dstring")
12echo "$(gettext "Simple dstring inside double-quotes")"
13echo $(gettext "Simple decorated dstring: \"x\" \\\"y\\\"")
14echo "$(gettext "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes")"
15EOF
16
17: ${XGETTEXT=xgettext}
18${XGETTEXT} --omit-header --no-location -d xg-sh-5.tmp xg-sh-5.sh || Exit 1
19LC_ALL=C tr -d '\r' < xg-sh-5.tmp.po > xg-sh-5.po || Exit 1
20
21cat <<\EOF > xg-sh-5.ok
22msgid "Simple string"
23msgstr ""
24
25msgid "Simple string inside double-quotes"
26msgstr ""
27
28msgid "Simple decorated string: \"x\" \\\"y\\\""
29msgstr ""
30
31msgid "Simple decorated string: \"x\" \\\"y\\\" inside double-quotes"
32msgstr ""
33
34msgid "Simple dstring"
35msgstr ""
36
37msgid "Simple dstring inside double-quotes"
38msgstr ""
39
40msgid "Simple decorated dstring: \"x\" \\\"y\\\""
41msgstr ""
42
43msgid "Simple decorated dstring: \"x\" \\\"y\\\" inside double-quotes"
44msgstr ""
45EOF
46
47: ${DIFF=diff}
48${DIFF} xg-sh-5.ok xg-sh-5.po
49result=$?
50
51exit $result
52