3 # Test checking of Python format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles="$tmpfiles f-lu-2.data"
9 cat <<\EOF > f-lu-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 # Valid: type compatibility
43 # Valid: type compatibility
46 # Valid: type compatibility
49 # Valid: type compatibility
52 # Invalid: type incompatibility
55 # Invalid: type incompatibility
58 # Invalid: type incompatibility
61 # Invalid: type incompatibility
64 # Invalid: type incompatibility
67 # Invalid: type incompatibility
70 # Invalid: type incompatibility
73 # Invalid: type incompatibility
76 # Invalid: type incompatibility
79 # Invalid: type incompatibility
82 # Invalid: type incompatibility
89 while read comment; do
93 tmpfiles="$tmpfiles f-lu-2-$n.po f-lu-2-$n.mo"
94 cat <<EOF > f-lu-2-$n.po
100 if echo "$comment" | grep 'Valid:' > /dev/null; then
101 if ${MSGFMT} --check-format -o f-lu-2-$n.mo f-lu-2-$n.po; then
107 ${MSGFMT} --check-format -o f-lu-2-$n.mo f-lu-2-$n.po 2> /dev/null
114 if test -n "$fail"; then
115 echo "Format string checking error:" 1>&2
116 cat f-lu-2-$n.po 1>&2
119 rm -f f-lu-2-$n.po f-lu-2-$n.mo