3 # Test checking of Shell format strings.
6 trap 'rm -fr $tmpfiles' 1 2 3 15
8 tmpfiles
="$tmpfiles f-sh-2.data"
9 cat <<\EOF
> f-sh-2.data
10 # Invalid: invalid msgstr
13 # Valid: same arguments, permutation
14 msgid
"abc$file in $dir"
15 msgstr
"xyz$dir o $file"
16 # Invalid: missing argument
19 # Invalid: added argument
21 msgstr
"xyz$file in $dir"
22 # Valid: braces or not, doesn't matter
25 # Invalid: different default value
27 msgstr
"xyz${file-/tmpdir}"
32 while read comment
; do
36 tmpfiles
="$tmpfiles f-sh-2-$n.po f-sh-2-$n.mo"
37 cat <<EOF > f-sh-2-$n.po
43 if echo "$comment" |
grep 'Valid:' > /dev
/null
; then
44 if ${MSGFMT} --check-format -o f-sh-2-
$n.mo f-sh-2-
$n.po
; then
50 ${MSGFMT} --check-format -o f-sh-2-
$n.mo f-sh-2-
$n.po
2> /dev
/null
57 if test -n "$fail"; then
58 echo "Format string checking error:" 1>&2
62 rm -f f-sh-2-
$n.po f-sh-2-
$n.mo