2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of Java format strings.
6 cat <<\EOF > f-cs-2.data
7 # Invalid: invalid msgstr
10 # Valid: same arguments
13 # Valid: same arguments, differently written
17 msgid "abc{2}{0}{1}def"
19 # Invalid: too few arguments
22 # Invalid: too many arguments
25 # Valid: missing non-final argument
28 # Valid: added non-final argument
31 # Invalid: different number of arguments
32 msgid "abc{500000000}def"
33 msgstr "xyz{500000001}"
34 # Valid: type compatibility
41 while read comment; do
45 cat <<EOF > f-cs-2-$n.po
51 if echo "$comment" | grep 'Valid:' > /dev/null; then
52 if ${MSGFMT} --check-format -o f-cs-2-$n.mo f-cs-2-$n.po; then
58 ${MSGFMT} --check-format -o f-cs-2-$n.mo f-cs-2-$n.po 2> /dev/null
65 if test -n "$fail"; then
66 echo "Format string checking error:" 1>&2
70 rm -f f-cs-2-$n.po f-cs-2-$n.mo