3 # Test recognition of C# format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-cs-1.data"
9 cat <<\EOF
> f-cs-1.data
12 # Valid: ten arguments
14 # Valid: two-digit argument numbers
16 # Valid: huge argument numbers
18 # Invalid: unterminated
20 # Invalid: unterminated
22 # Invalid: missing number
28 # Valid: two arguments
30 # Valid: multiple uses of same argument
32 # Invalid: invalid width
34 # Invalid: invalid width
38 # Valid: format specifiers
40 # Valid: width and format specifiers
42 # Invalid: missing opening brace
44 # Invalid: quoted brace
46 # Valid: doubled brace
48 # Invalid: doubled brace doesn't start a directive
52 : ${XGETTEXT=xgettext}
54 while read comment
; do
57 tmpfiles
="$tmpfiles f-cs-1-$n.in f-cs-1-$n.po"
58 cat <<EOF > f-cs-1-$n.in
61 ${XGETTEXT} -L C
# -o f-cs-1-$n.po f-cs-1-$n.in || exit 1
62 test -f f-cs-1-
$n.po ||
exit 1
64 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
65 if grep csharp-format f-cs-1-
$n.po
> /dev
/null
; then
71 if grep csharp-format f-cs-1-
$n.po
> /dev
/null
; then
77 if test -n "$fail"; then
78 echo "Format string recognition error:" 1>&2
84 rm -f f-cs-1-
$n.
in f-cs-1-
$n.po