3 # Test recognition of Object Pascal format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-op-1.data"
9 cat <<\EOF
> f-op-1.data
12 # Valid: one string argument
14 # Valid: one integer argument
16 # Valid: one integer argument
18 # Valid: one floating-point argument
20 # Valid: one floating-point argument
22 # Valid: one floating-point argument
24 # Valid: one floating-point argument
26 # Valid: one floating-point argument
28 # Valid: one pointer argument
30 # Valid: one argument with flags
32 # Valid: one argument with width
34 # Valid: one argument with width
36 # Valid: one argument with precision
38 # Valid: one argument with precision
40 # Valid: one argument with width and precision
42 # Valid: one argument with width and precision
44 # Valid: one argument with width and precision
46 # Valid: one argument with width and precision
48 # Invalid: unterminated
50 # Invalid: unknown format specifier
52 # Invalid: flags after width
54 # Invalid: twice precision
56 # Valid: three arguments
58 # Valid: a numbered argument
60 # Valid: two-digit numbered arguments
61 "abc%10:def%9:dgh%8:dij%7:dkl%6:dmn%5:dop%4:dqr%3:dst%2:duv%1:dwx%0:dyz"
62 # Invalid: unterminated number
64 # Invalid: flags before number
66 # Valid: three arguments, two with same number
68 # Invalid: argument with conflicting types
70 # Invalid: argument with conflicting types
72 # Valid: argument with different but not conflicting types
74 # Valid: mixing of numbered and unnumbered arguments
76 # Valid: numbered argument with constant precision
78 # Valid: mixing of numbered and unnumbered arguments
80 # Valid: missing non-final argument
84 # Valid: multiple uses of same argument
85 "abc%2:xdef%1:pghi%2:x"
86 # Valid: one argument with width
88 # Valid: one argument with width and precision
92 : ${XGETTEXT=xgettext}
94 while read comment
; do
97 tmpfiles
="$tmpfiles f-op-1-$n.in f-op-1-$n.po"
98 echo "x.y=${string}" |
sed -e "s/\"/'/g" > f-op-1-
$n.
in
99 ${XGETTEXT} -L RST
-o f-op-1-
$n.po f-op-1-
$n.
in ||
exit 1
100 test -f f-op-1-
$n.po ||
exit 1
102 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
103 if grep object-pascal-format f-op-1-
$n.po
> /dev
/null
; then
109 if grep object-pascal-format f-op-1-
$n.po
> /dev
/null
; then
115 if test -n "$fail"; then
116 echo "Format string recognition error:" 1>&2
117 cat f-op-1-
$n.
in 1>&2
119 cat f-op-1-
$n.po
1>&2
122 rm -f f-op-1-
$n.
in f-op-1-
$n.po