2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test recognition of C# format strings.
6 cat <<\EOF > f-cs-1.data
11 # Valid: two-digit argument numbers
13 # Valid: huge argument numbers
15 # Invalid: unterminated
17 # Invalid: unterminated
19 # Invalid: missing number
25 # Valid: two arguments
27 # Valid: multiple uses of same argument
29 # Invalid: invalid width
31 # Invalid: invalid width
35 # Valid: format specifiers
37 # Valid: width and format specifiers
39 # Invalid: missing opening brace
41 # Invalid: quoted brace
43 # Valid: doubled brace
45 # Invalid: doubled brace doesn't start a directive
49 : ${XGETTEXT=xgettext}
51 while read comment; do
54 cat <<EOF > f-cs-1-$n.in
57 ${XGETTEXT} -L C# -o f-cs-1-$n.po f-cs-1-$n.in || exit 1
58 test -f f-cs-1-$n.po || exit 1
60 if echo "$comment" | grep 'Valid:' > /dev/null; then
61 if grep csharp-format f-cs-1-$n.po > /dev/null; then
67 if grep csharp-format f-cs-1-$n.po > /dev/null; then
73 if test -n "$fail"; then
74 echo "Format string recognition error:" 1>&2
80 rm -f f-cs-1-$n.in f-cs-1-$n.po