3 # Test checking of Java format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-cs-2.data"
9 cat <<\EOF
> f-cs-2.data
10 # Invalid: invalid msgstr
13 # Valid: same arguments
16 # Valid: same arguments, differently written
20 msgid
"abc{2}{0}{1}def"
22 # Invalid: too few arguments
25 # Invalid: too many arguments
28 # Valid: missing non-final argument
31 # Valid: added non-final argument
34 # Invalid: different number of arguments
35 msgid
"abc{500000000}def"
36 msgstr
"xyz{500000001}"
37 # Valid: type compatibility
44 while read comment
; do
48 tmpfiles
="$tmpfiles f-cs-2-$n.po f-cs-2-$n.mo"
49 cat <<EOF > f-cs-2-$n.po
55 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
56 if ${MSGFMT} --check-format -o f-cs-2-
$n.mo f-cs-2-
$n.po
; then
62 ${MSGFMT} --check-format -o f-cs-2-
$n.mo f-cs-2-
$n.po
2> /dev
/null
69 if test -n "$fail"; then
70 echo "Format string checking error:" 1>&2
74 rm -f f-cs-2-
$n.po f-cs-2-
$n.mo