3 # Test recognition of Shell format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-sh-1.data"
9 cat <<\EOF
> f-sh-1.data
10 # Invalid: no argument
16 # Invalid: context dependent variable
18 # Invalid: context dependent variable
20 # Invalid: complex shell syntax
22 # Invalid: unterminated
24 # Invalid: unterminated name
26 # Invalid: non-ASCII character
28 # Invalid: non-ASCII character
30 # Invalid: an empty name
32 # Valid: three arguments
34 # Valid: three arguments, two with equal names
38 : ${XGETTEXT=xgettext}
40 while read comment
; do
43 tmpfiles
="$tmpfiles f-sh-1-$n.in f-sh-1-$n.po"
44 sed -e 's,\$,\\$,g' <<EOF > f-sh-1-$n.in
47 ${XGETTEXT} -L Shell
--from-code=ISO-8859-1
-o f-sh-1-
$n.po f-sh-1-
$n.
in ||
exit 1
48 test -f f-sh-1-
$n.po ||
exit 1
50 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
51 if grep sh-format f-sh-1-
$n.po
> /dev
/null
; then
57 if grep sh-format f-sh-1-
$n.po
> /dev
/null
; then
63 if test -n "$fail"; then
64 echo "Format string recognition error:" 1>&2
70 rm -f f-sh-1-
$n.
in f-sh-1-
$n.po