2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of Tcl format strings.
6 cat <<\EOF > f-t-2.data
7 # Valid: %% doesn't count
10 # Invalid: invalid msgstr
13 # Valid: same arguments
16 # Valid: same arguments, with different widths
19 # Valid: same arguments but in numbered syntax
24 msgstr "xyz%3$c%2$g%1$s"
25 # Invalid: too few arguments
26 msgid "abc%2$udef%1$s"
28 # Invalid: too few arguments
31 # Invalid: too many arguments
34 # Valid: same numbered arguments, with different widths
36 msgstr "xyz%2$4s%1$5s"
37 # Invalid: missing argument
38 msgid "abc%2$sdef%1$u"
40 # Invalid: missing argument
41 msgid "abc%1$sdef%2$u"
43 # Invalid: added argument
45 msgstr "xyz%1$uvw%2$c"
46 # Valid: type compatibility
49 # Valid: type compatibility
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 # Invalid: type incompatibility
73 # Invalid: type incompatibility
76 # Invalid: type incompatibility
79 # Invalid: type incompatibility
82 # Invalid: type incompatibility
85 # Invalid: type incompatibility
88 # Invalid: type incompatibility
91 # Invalid: type incompatibility
94 # Invalid: type incompatibility
97 # Invalid: type incompatibility
100 # Invalid: type incompatibility for width
107 while read comment; do
111 cat <<EOF > f-t-2-$n.po
117 if echo "$comment" | grep 'Valid:' > /dev/null; then
118 if ${MSGFMT} --check-format -o f-t-2-$n.mo f-t-2-$n.po; then
124 ${MSGFMT} --check-format -o f-t-2-$n.mo f-t-2-$n.po 2> /dev/null
131 if test -n "$fail"; then
132 echo "Format string checking error:" 1>&2
136 rm -f f-t-2-$n.po f-t-2-$n.mo