3 # Test checking of JavaScript format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles f-js-2.data"
9 cat <<\EOF > f-js-2.data
10 # Valid: %% doesn't count
13 # Invalid: invalid msgstr
16 # Valid: same arguments, with different widths
19 # Invalid: too few arguments
22 # Invalid: too many arguments
25 # Valid: type compatibility
28 # Valid: type compatibility
31 # Valid: type compatibility
34 # Valid: type compatibility
37 # Valid: type compatibility
40 # Invalid: type incompatibility
43 # Invalid: type incompatibility
46 # Invalid: type incompatibility
53 while read comment; do
57 tmpfiles="$tmpfiles f-js-2-$n.po f-js-2-$n.mo"
58 cat <<EOF > f-js-2-$n.po
64 if echo "$comment" | grep 'Valid:' > /dev/null; then
65 if ${MSGFMT} --check-format -o f-js-2-$n.mo f-js-2-$n.po; then
71 ${MSGFMT} --check-format -o f-js-2-$n.mo f-js-2-$n.po 2> /dev/null
78 if test -n "$fail"; then
79 echo "Format string checking error:" 1>&2
83 rm -f f-js-2-$n.po f-js-2-$n.mo