#! /bin/sh
tmpfiles=""
trap 'rm -fr $tmpfiles' 1 2 3 15
tmpfiles="$tmpfiles mm-test1.in1 mm-test1.in2"
cat <<EOF > mm-test1.in1
msgid "1"
msgstr "1x"
msgid "2"
msgstr "this is a really long msgstr "
"used to test the wrapping to "
"make sure it works after all "
"what is a test for if not to test things?"
msgid "3"
msgstr "3z"
EOF
cat <<EOF > mm-test1.in2
msgid "1"
msgstr ""
msgid "2"
msgstr ""
msgid "3"
msgstr ""
EOF
tmpfiles="$tmpfiles mm-test1.out"
: ${MSGMERGE=msgmerge}
${MSGMERGE} -q mm-test1.in1 mm-test1.in2 -o mm-test1.out
test $? = 0 || { rm -fr $tmpfiles; exit 1; }
tmpfiles="$tmpfiles mm-test1.ok"
cat << EOF > mm-test1.ok
msgid "1"
msgstr "1x"
msgid "2"
msgstr ""
"this is a really long msgstr used to test the wrapping to make sure it works "
"after all what is a test for if not to test things?"
msgid "3"
msgstr "3z"
EOF
: ${DIFF=diff}
${DIFF} mm-test1.ok mm-test1.out
result=$?
rm -fr $tmpfiles
exit $result