2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of Perl brace format strings.
6 cat <<\EOF > f-pb-2.data
7 # Valid: same named arguments
8 msgid "abc{date}{time}"
9 msgstr "xyz{date}{time}"
11 msgid "abc{x3}{x1}{x2}def"
12 msgstr "xyz{x2}{x1}{x3}"
13 # Invalid: missing argument
14 msgid "abc{x2}def{x1}"
16 # Invalid: missing argument
17 msgid "abc{x1}def{x2}"
19 # Valid: added argument (valid since "{zoo}" expands to itself)
21 msgstr "xyz{foo}uvw{zoo}"
22 # Valid: multiple reuse of same argument
23 msgid "{foo} {bar} {baz}"
24 msgstr "{baz} {bar} {foo} {bar}"
25 # Valid: single reuse of same argument
26 msgid "{baz} {bar} {foo} {bar}"
27 msgstr "{foo} {bar} {baz}"
32 while read comment; do
36 cat <<EOF > f-pb-2-$n.po
42 if echo "$comment" | grep 'Valid:' > /dev/null; then
43 if ${MSGFMT} --check-format -o f-pb-2-$n.mo f-pb-2-$n.po; then
49 ${MSGFMT} --check-format -o f-pb-2-$n.mo f-pb-2-$n.po 2> /dev/null
56 if test -n "$fail"; then
57 echo "Format string checking error:" 1>&2
61 rm -f f-pb-2-$n.po f-pb-2-$n.mo