2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test recognition of Perl format strings of both kinds (printf and brace).
5 # This test is for the combination of both kinds.
8 cat <<\EOF > f-pm-1.data
10 #, perl-format, perl-brace-format
11 "{foo} %c {bar} %d {baz}"
15 # printf format only, because '%' is not allowed in identifier.
18 # Valid bracketed format because there is still one valid identifier.
19 #, perl-format, perl-brace-format
21 # Bracketed format only, because %l is not recognized in printf format.
24 # Neither format recognized here.
29 : ${XGETTEXT=xgettext}
31 while read comment; do
35 cat <<EOF > f-pm-1-$n.in
38 ${XGETTEXT} -L perl --omit-header --no-location -o f-pm-1-$n.po f-pm-1-$n.in || exit 1
39 test -f f-pm-1-$n.po || exit 1
41 if test -n "${formats}"; then
42 # Verify that the first line contains the expected #, comment.
43 if sed 1q < f-pm-1-$n.po | LC_ALL=C tr -d '\r' | grep '^'"${formats}"'$' > /dev/null; then
49 # Verify that there is no #, comment.
50 if sed 1q < f-pm-1-$n.po | grep '^msgid' > /dev/null; then
56 if test -n "$fail"; then
57 echo "Format string recognition error:" 1>&2