2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test recognition of Perl brace format strings.
6 cat <<\EOF > f-pb-1.data
9 # Valid: a named argument
11 # Invalid: an empty name
13 # Invalid: unterminated name
15 # Valid: three arguments, two with equal names
16 "abc{addr},{char},{addr}"
17 # Invalid: place-holder contains a space.
19 # Invalid: missing right angle bracket.
21 # Valid: not nested, but one single place-holder.
23 # Valid: no nesting error, but one single place-holder.
25 # Valid: place-holder with spaces must be ignored, but still one remaining.
27 # Invalid: percent sign not allowed.
31 : ${XGETTEXT=xgettext}
33 while read comment; do
36 cat <<EOF > f-pb-1-$n.in
39 ${XGETTEXT} -L Perl -o f-pb-1-$n.po f-pb-1-$n.in || exit 1
40 test -f f-pb-1-$n.po || exit 1
42 if echo "$comment" | grep 'Valid:' > /dev/null; then
43 if grep perl-brace-format f-pb-1-$n.po > /dev/null; then
49 if grep perl-brace-format f-pb-1-$n.po > /dev/null; then
55 if test -n "$fail"; then
56 echo "Format string recognition error:" 1>&2
62 rm -f f-pb-1-$n.in f-pb-1-$n.po