3 # Test recognition of Perl brace format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-pb-1.data"
9 cat <<\EOF
> f-pb-1.data
10 # Invalid: no argument
12 # Valid: a named argument
14 # Invalid: an empty name
16 # Invalid: unterminated name
18 # Valid: three arguments, two with equal names
19 "abc{addr},{char},{addr}"
20 # Invalid: place-holder contains a space.
22 # Invalid: missing right angle bracket.
24 # Valid: not nested, but one single place-holder.
26 # Valid: no nesting error, but one single place-holder.
28 # Valid: place-holder with spaces must be ignored, but still one remaining.
30 # Invalid: percent sign not allowed.
34 : ${XGETTEXT=xgettext}
36 while read comment
; do
39 tmpfiles
="$tmpfiles f-pb-1-$n.in f-pb-1-$n.po"
40 cat <<EOF > f-pb-1-$n.in
43 ${XGETTEXT} -L Perl
-o f-pb-1-
$n.po f-pb-1-
$n.
in ||
exit 1
44 test -f f-pb-1-
$n.po ||
exit 1
46 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
47 if grep perl-brace-format f-pb-1-
$n.po
> /dev
/null
; then
53 if grep perl-brace-format f-pb-1-
$n.po
> /dev
/null
; then
59 if test -n "$fail"; then
60 echo "Format string recognition error:" 1>&2
66 rm -f f-pb-1-
$n.
in f-pb-1-
$n.po