2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of Boost format strings.
6 cat <<\EOF > f-bo-2.data
7 # Valid: %% doesn't count
10 # Invalid: invalid msgstr
13 # Valid: same arguments
16 # Valid: same arguments, despite different syntax
19 # Valid: same arguments, with different widths
22 # Valid: same arguments but in numbered syntax
25 # Valid: same arguments but in numbered syntax
30 msgstr "xyz%3$c%2$g%1$s"
31 # Invalid: too few arguments
32 msgid "abc%2$udef%1$s"
34 # Invalid: too few arguments
37 # Invalid: too many arguments
40 # Valid: same numbered arguments, with different widths
42 msgstr "xyz%2$4s%1$5s"
43 # Invalid: missing argument
44 msgid "abc%2$sdef%1$u"
46 # Invalid: missing argument
47 msgid "abc%1$sdef%2$u"
49 # Invalid: added argument
51 msgstr "xyz%1$uvw%2$c"
52 # Valid: type compatibility
55 # Valid: type compatibility
58 # Valid: type compatibility
61 # Valid: type compatibility
64 # Valid: type compatibility
67 # Valid: type compatibility
70 # Valid: type compatibility
73 # Valid: type compatibility
76 # Valid: type compatibility
79 # Invalid: type incompatibility
82 # Invalid: type incompatibility
85 # Invalid: type incompatibility
88 # Invalid: type incompatibility
91 # Invalid: different argument count
94 # Invalid: type incompatibility
97 # Invalid: type incompatibility
100 # Invalid: type incompatibility
103 # Invalid: different argument count
106 # Invalid: type incompatibility
109 # Invalid: type incompatibility
112 # Invalid: different argument count
115 # Invalid: type incompatibility
118 # Invalid: different argument count
121 # Invalid: different argument count
124 # Valid: size is ignored
127 # Valid: size is ignored
130 # Valid: size is ignored
133 # Valid: size is ignored
136 # Valid: size is ignored
139 # Valid: size is ignored
142 # Valid: size is ignored
145 # Valid: size is ignored
148 # Valid: size is ignored
151 # Valid: size is ignored
154 # Valid: size is ignored
157 # Valid: size is ignored
160 # Valid: size is ignored
163 # Valid: size is ignored
166 # Invalid: type incompatibility for width
173 while read comment; do
177 cat <<EOF > f-bo-2-$n.po
183 if echo "$comment" | grep 'Valid:' > /dev/null; then
184 if ${MSGFMT} --check-format -o f-bo-2-$n.mo f-bo-2-$n.po; then
190 ${MSGFMT} --check-format -o f-bo-2-$n.mo f-bo-2-$n.po 2> /dev/null
197 if test -n "$fail"; then
198 echo "Format string checking error:" 1>&2
199 cat f-bo-2-$n.po 1>&2
202 rm -f f-bo-2-$n.po f-bo-2-$n.mo