2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of KDE KUIT format strings.
6 cat <<\EOF > f-kd-invalid.po
14 LC_ALL=C ${MSGFMT} --check-format -o /dev/null f-kd-invalid.po 2>&1 | grep 'not a valid KDE KUIT format' > /dev/null 2>&1
16 echo "Skipping test: msgfmt was built without KDE KUIT format support"
20 cat <<\EOF > f-kd-2.data
22 msgid "<filename>%1</filename>"
23 msgstr "<filename>%1</filename>"
24 # Invalid: missing argument
25 msgid "<filename>%1</filename>"
26 msgstr "<filename>foo</filename>"
27 # Valid: change the text
28 msgid "<filename>foo</filename>"
29 msgstr "<filename>bar</filename>"
30 # Invalid: unbalanced tag
31 msgid "<filename>foo</filename>"
32 msgstr "<filename>bar"
33 # Invalid: unbalanced tag
34 msgid "<filename>foo</filename>"
35 msgstr "<filename>bar</xfilename>"
37 msgid "<filename>foo</filename>"
38 msgstr "<foo>foo</foo>"
40 msgid "<filename>&foo</filename>"
41 msgstr "<foo>&foo</foo>"
42 # Valid: entity reference
43 msgid "<filename>foo</filename>"
44 msgstr "<foo>&</foo>"
48 while read comment; do
52 cat <<EOF > f-kd-2-$n.po
58 if echo "$comment" | grep 'Valid:' > /dev/null; then
59 if ${MSGFMT} --check-format -o f-kd-2-$n.mo f-kd-2-$n.po; then
65 ${MSGFMT} --check-format -o f-kd-2-$n.mo f-kd-2-$n.po 2> /dev/null
72 if test -n "$fail"; then
73 echo "Format string checking error:" 1>&2
77 rm -f f-kd-2-$n.po f-kd-2-$n.mo