1#!/bin/sh
2. "${srcdir=.}/init.sh"; path_prepend_ . ../src
3
4# Test of Shell support: assignment syntax.
5
6cat <<\EOF > xg-sh-7.sh
7gettext 'immediate invocation'
8foo=bar gettext 'invocation with 1 environment variable'
9foo=bar FOO=baz gettext 'invocation with 2 environment variables'
10env gettext 'invocation with env'
11env foo=bar gettext 'invocation with env and 1 environment variable'
12env foo=bar FOO=baz gettext 'invocation with env and 2 environment variables'
13'foo'=bar gettext 'invocation after a non-assignment 1'
14"foo"=bar gettext 'invocation after a non-assignment 2'
15fo\o=bar gettext 'invocation after a non-assignment 3'
16foo'='bar gettext 'invocation after a non-assignment 4'
17foo"="bar gettext 'invocation after a non-assignment 5'
18foo\=bar gettext 'invocation after a non-assignment 6'
197=bar gettext 'invocation after a non-assignment 7'
20océ=bar gettext 'invocation after a non-assignment 8'
21f0oO_=bar gettext 'invocation with a mixed environment variable'
22EOF
23
24: ${XGETTEXT=xgettext}
25${XGETTEXT} --omit-header --no-location -d xg-sh-7.tmp xg-sh-7.sh || Exit 1
26LC_ALL=C tr -d '\r' < xg-sh-7.tmp.po > xg-sh-7.po || Exit 1
27
28cat <<\EOF > xg-sh-7.ok
29msgid "immediate invocation"
30msgstr ""
31
32msgid "invocation with 1 environment variable"
33msgstr ""
34
35msgid "invocation with 2 environment variables"
36msgstr ""
37
38msgid "invocation with env"
39msgstr ""
40
41msgid "invocation with env and 1 environment variable"
42msgstr ""
43
44msgid "invocation with env and 2 environment variables"
45msgstr ""
46
47msgid "invocation with a mixed environment variable"
48msgstr ""
49EOF
50
51: ${DIFF=diff}
52${DIFF} xg-sh-7.ok xg-sh-7.po
53result=$?
54
55exit $result
56