2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test recognition of Object Pascal format strings.
6 cat <<\EOF > f-op-1.data
9 # Valid: one string argument
11 # Valid: one integer argument
13 # Valid: one integer argument
15 # Valid: one floating-point argument
17 # Valid: one floating-point argument
19 # Valid: one floating-point argument
21 # Valid: one floating-point argument
23 # Valid: one floating-point argument
25 # Valid: one pointer argument
27 # Valid: one argument with flags
29 # Valid: one argument with width
31 # Valid: one argument with width
33 # Valid: one argument with precision
35 # Valid: one argument with precision
37 # Valid: one argument with width and precision
39 # Valid: one argument with width and precision
41 # Valid: one argument with width and precision
43 # Valid: one argument with width and precision
45 # Invalid: unterminated
47 # Invalid: unknown format specifier
49 # Invalid: flags after width
51 # Invalid: twice precision
53 # Valid: three arguments
55 # Valid: a numbered argument
57 # Valid: a numbered argument with omitted number
59 # Valid: two-digit numbered arguments
60 "abc%10:def%9:dgh%8:dij%7:dkl%6:dmn%5:dop%4:dqr%3:dst%2:duv%1:dwx%0:dyz"
61 # Invalid: unterminated number
63 # Invalid: flags before number
65 # Valid: three arguments, two with same number
67 # Invalid: argument with conflicting types
69 # Invalid: argument with conflicting types
71 # Valid: argument with different but not conflicting types
73 # Valid: mixing of numbered and unnumbered arguments
75 # Valid: numbered argument with constant precision
77 # Valid: mixing of numbered and unnumbered arguments
79 # Valid: missing non-final argument
83 # Valid: multiple uses of same argument
84 "abc%2:xdef%1:pghi%2:x"
85 # Valid: one argument with width
87 # Valid: one argument with width and precision
91 : ${XGETTEXT=xgettext}
93 while read comment; do
96 echo "x.y=${string}" | sed -e "s/\"/'/g" > f-op-1-$n.in
97 ${XGETTEXT} -L RST -o f-op-1-$n.po f-op-1-$n.in || exit 1
98 test -f f-op-1-$n.po || exit 1
100 if echo "$comment" | grep 'Valid:' > /dev/null; then
101 if grep object-pascal-format f-op-1-$n.po > /dev/null; then
107 if grep object-pascal-format f-op-1-$n.po > /dev/null; then
113 if test -n "$fail"; then
114 echo "Format string recognition error:" 1>&2
115 cat f-op-1-$n.in 1>&2
117 cat f-op-1-$n.po 1>&2
120 rm -f f-op-1-$n.in f-op-1-$n.po