2 . "${srcdir=.}/init.sh"; path_prepend_ . ../src
4 # Test checking of Shell format strings.
6 cat <<\EOF > f-sh-2.data
7 # Invalid: invalid msgstr
10 # Valid: same arguments, permutation
11 msgid "abc$file in $dir"
12 msgstr "xyz$dir o $file"
13 # Invalid: missing argument
16 # Invalid: added argument
18 msgstr "xyz$file in $dir"
19 # Valid: braces or not, doesn't matter
22 # Invalid: different default value
24 msgstr "xyz${file-/tmpdir}"
29 while read comment; do
33 cat <<EOF > f-sh-2-$n.po
39 if echo "$comment" | grep 'Valid:' > /dev/null; then
40 if ${MSGFMT} --check-format -o f-sh-2-$n.mo f-sh-2-$n.po; then
46 ${MSGFMT} --check-format -o f-sh-2-$n.mo f-sh-2-$n.po 2> /dev/null
53 if test -n "$fail"; then
54 echo "Format string checking error:" 1>&2
58 rm -f f-sh-2-$n.po f-sh-2-$n.mo