3 # Test checking of Object Pascal format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-op-2.data"
9 cat <<\EOF
> f-op-2.data
10 # Valid: %% doesn't count
13 # Invalid: invalid msgstr
16 # Valid: same arguments
19 # Valid: same arguments, with different widths
22 # Valid: same arguments but in numbered syntax
27 msgstr
"xyz%2:c%1:g%0:s"
28 # Invalid: too few arguments
29 msgid
"abc%1:xdef%0:s"
31 # Invalid: too few arguments
34 # Invalid: too many arguments
37 # Valid: same numbered arguments, with different widths
39 msgstr
"xyz%1:4s%0:5s"
40 # Invalid: missing argument
41 msgid
"abc%1:sdef%0:x"
43 # Invalid: missing argument
44 msgid
"abc%0:sdef%1:x"
46 # Invalid: added argument
48 msgstr
"xyz%0:xvw%1:p"
49 # Valid: type compatibility
52 # Valid: type compatibility
55 # Valid: type compatibility
58 # Valid: type compatibility
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
85 # Invalid: type incompatibility
88 # Invalid: type incompatibility
91 # Invalid: type incompatibility for width
98 while read comment
; do
102 tmpfiles
="$tmpfiles f-op-2-$n.po f-op-2-$n.mo"
103 cat <<EOF > f-op-2-$n.po
104 #, object-pascal-format
109 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
110 if ${MSGFMT} --check-format -o f-op-2-
$n.mo f-op-2-
$n.po
; then
116 ${MSGFMT} --check-format -o f-op-2-
$n.mo f-op-2-
$n.po
2> /dev
/null
123 if test -n "$fail"; then
124 echo "Format string checking error:" 1>&2
125 cat f-op-2-
$n.po
1>&2
128 rm -f f-op-2-
$n.po f-op-2-
$n.mo