2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of Object Pascal format strings.
6 cat <<\EOF > f-op-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%2:c%1:g%0:s"
25 # Invalid: too few arguments
26 msgid "abc%1:xdef%0:s"
28 # Invalid: too few arguments
31 # Invalid: too many arguments
34 # Valid: same numbered arguments, with different widths
36 msgstr "xyz%1:4s%0:5s"
37 # Valid: same numbered arguments
40 # Valid: same numbered arguments
43 # Invalid: missing argument
44 msgid "abc%1:sdef%0:x"
46 # Invalid: missing argument
47 msgid "abc%0:sdef%1:x"
49 # Invalid: added argument
51 msgstr "xyz%0:xvw%1:p"
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 # 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 for width
98 while read comment; do
102 cat <<EOF > f-op-2-$n.po
103 #, object-pascal-format
108 if echo "$comment" | grep 'Valid:' > /dev/null; then
109 if ${MSGFMT} --check-format -o f-op-2-$n.mo f-op-2-$n.po; then
115 ${MSGFMT} --check-format -o f-op-2-$n.mo f-op-2-$n.po 2> /dev/null
122 if test -n "$fail"; then
123 echo "Format string checking error:" 1>&2
124 cat f-op-2-$n.po 1>&2
127 rm -f f-op-2-$n.po f-op-2-$n.mo