2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test recognition of KDE format strings.
6 cat <<\EOF > f-kd-1.data
7 # Unrecognized: no argument
11 # Unrecognized: no argument (digit sequence starting with a zero)
13 # Valid: one argument, digit sequence starting with a zero
15 # Valid: one argument, digit sequence starting with a zero
18 "abc%1%2%3%4%9%7%8%5%6def"
19 # Valid: 9 arguments, missing one of them
20 "abc%1%2%3%4%9%7%5%6def"
21 # Invalid: one argument but missing arguments %1 ... %8
23 # Valid: more than ten arguments, missing one of them
24 "abc%1%2%3%4%9%7%5%6%12%10%11def"
25 # Invalid: one argument specified by two digits but missing arguments %1 ... %98
35 # Valid: multiple uses of same argument
37 # Unrecognized: no argument
39 # Unrecognized: no argument
43 : ${XGETTEXT=xgettext}
45 while read comment; do
48 cat <<EOF > f-kd-1-$n.in
51 ${XGETTEXT} -L C++ --kde -k_ -o f-kd-1-$n.po f-kd-1-$n.in || exit 1
52 test -f f-kd-1-$n.po || exit 1
54 if echo "$comment" | grep 'Valid:' > /dev/null; then
55 if grep kde-format f-kd-1-$n.po > /dev/null; then
61 if grep kde-format f-kd-1-$n.po > /dev/null; then
67 if test -n "$fail"; then
68 echo "Format string recognition error:" 1>&2
74 rm -f f-kd-1-$n.in f-kd-1-$n.po