3 # Test checking of Perl brace format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-pb-2.data"
9 cat <<\EOF
> f-pb-2.data
10 # Valid: same named arguments
11 msgid
"abc{date}{time}"
12 msgstr
"xyz{date}{time}"
14 msgid
"abc{x3}{x1}{x2}def"
15 msgstr
"xyz{x2}{x1}{x3}"
16 # Invalid: missing argument
17 msgid
"abc{x2}def{x1}"
19 # Invalid: missing argument
20 msgid
"abc{x1}def{x2}"
22 # Valid: added argument (valid since "{zoo}" expands to itself)
24 msgstr
"xyz{foo}uvw{zoo}"
25 # Valid: multiple reuse of same argument
26 msgid
"{foo} {bar} {baz}"
27 msgstr
"{baz} {bar} {foo} {bar}"
28 # Valid: single reuse of same argument
29 msgid
"{baz} {bar} {foo} {bar}"
30 msgstr
"{foo} {bar} {baz}"
35 while read comment
; do
39 tmpfiles
="$tmpfiles f-pb-2-$n.po f-pb-2-$n.mo"
40 cat <<EOF > f-pb-2-$n.po
46 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
47 if ${MSGFMT} --check-format -o f-pb-2-
$n.mo f-pb-2-
$n.po
; then
53 ${MSGFMT} --check-format -o f-pb-2-
$n.mo f-pb-2-
$n.po
2> /dev
/null
60 if test -n "$fail"; then
61 echo "Format string checking error:" 1>&2
65 rm -f f-pb-2-
$n.po f-pb-2-
$n.mo