summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2001-12-11 11:43:08 +0000
committerBruno Haible <bruno@clisp.org>2009-06-21 23:40:35 +0200
commit71d0e73ab00092bdf6f27a6f93c82c4815c3f1fe (patch)
tree6516c74041b21963b35d875b26345b7b2e343ffb /tests
parent4c584eba3e466748fea9ffa5dc2e0559339a311d (diff)
downloadexternal_gettext-71d0e73ab00092bdf6f27a6f93c82c4815c3f1fe.zip
external_gettext-71d0e73ab00092bdf6f27a6f93c82c4815c3f1fe.tar.gz
external_gettext-71d0e73ab00092bdf6f27a6f93c82c4815c3f1fe.tar.bz2
Tests for new programs.
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog31
-rw-r--r--tests/Makefile.am16
-rwxr-xr-xtests/msgattrib-1103
-rwxr-xr-xtests/msgattrib-10103
-rwxr-xr-xtests/msgattrib-11120
-rwxr-xr-xtests/msgattrib-1287
-rwxr-xr-xtests/msgattrib-1394
-rwxr-xr-xtests/msgattrib-1490
-rwxr-xr-xtests/msgattrib-297
-rwxr-xr-xtests/msgattrib-3111
-rwxr-xr-xtests/msgattrib-489
-rwxr-xr-xtests/msgattrib-5106
-rwxr-xr-xtests/msgattrib-694
-rwxr-xr-xtests/msgattrib-794
-rwxr-xr-xtests/msgattrib-8126
-rwxr-xr-xtests/msgattrib-9118
-rwxr-xr-xtests/msgconv-149
-rwxr-xr-xtests/msgconv-250
-rwxr-xr-xtests/msgen-164
-rwxr-xr-xtests/msgexec-1136
-rwxr-xr-xtests/msgexec-279
-rwxr-xr-xtests/msgfilter-1140
-rwxr-xr-xtests/msgfilter-2128
-rwxr-xr-xtests/msggrep-1195
-rwxr-xr-xtests/msggrep-2257
-rwxr-xr-xtests/msggrep-3219
-rwxr-xr-xtests/msggrep-4243
27 files changed, 3038 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 428854b..a6aa895 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,34 @@
+2001-12-08 Bruno Haible <bruno@clisp.org>
+
+ * msgattrib-1: New file.
+ * msgattrib-2: New file.
+ * msgattrib-3: New file.
+ * msgattrib-4: New file.
+ * msgattrib-5: New file.
+ * msgattrib-6: New file.
+ * msgattrib-7: New file.
+ * msgattrib-8: New file.
+ * msgattrib-9: New file.
+ * msgattrib-10: New file.
+ * msgattrib-11: New file.
+ * msgattrib-12: New file.
+ * msgattrib-13: New file.
+ * msgattrib-14: New file.
+ * msgconv-1: New file.
+ * msgconv-2: New file.
+ * msgen-1: New file.
+ * msgexec-1: New file.
+ * msgexec-2: New file.
+ * msgfilter-1: New file.
+ * msgfilter-2: New file.
+ * msggrep-1: New file.
+ * msggrep-2: New file.
+ * msggrep-3: New file.
+ * msggrep-4: New file.
+ * Makefile.am (TESTS): Add them.
+ (TESTS_ENVIRONMENT): Pass MSGATTRIB, MSGCOMM, MSGCONV, MSGEN, MSGEXEC,
+ MSGFILTER, MSGGREP variables to the tests.
+
2001-12-06 Bruno Haible <bruno@clisp.org>
* msgmerge-20: New file.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0fa8771..044ef79 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -20,14 +20,22 @@
AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
TESTS = gettext-1 gettext-2 \
+ msgattrib-1 msgattrib-2 msgattrib-3 msgattrib-4 msgattrib-5 \
+ msgattrib-6 msgattrib-7 msgattrib-8 msgattrib-9 msgattrib-10 \
+ msgattrib-11 msgattrib-12 msgattrib-13 msgattrib-14 \
msgcat-1 msgcat-2 msgcat-3 msgcat-4 msgcat-5 msgcat-6 msgcat-7 \
msgcmp-1 msgcmp-2 \
msgcomm-1 msgcomm-2 msgcomm-3 msgcomm-4 msgcomm-5 msgcomm-6 msgcomm-7 \
msgcomm-8 msgcomm-9 msgcomm-10 msgcomm-11 msgcomm-12 msgcomm-13 \
msgcomm-14 msgcomm-15 msgcomm-16 msgcomm-17 msgcomm-18 msgcomm-19 \
msgcomm-20 msgcomm-21 msgcomm-22 msgcomm-23 \
+ msgconv-1 msgconv-2 \
+ msgen-1 \
+ msgexec-1 msgexec-2 \
+ msgfilter-1 msgfilter-2 \
msgfmt-1 msgfmt-2 msgfmt-3 msgfmt-4 msgfmt-5 msgfmt-6 msgfmt-7 \
msgfmt-8 msgfmt-9 \
+ msggrep-1 msggrep-2 msggrep-3 msggrep-4 \
msgmerge-1 msgmerge-2 msgmerge-3 msgmerge-4 msgmerge-5 msgmerge-6 \
msgmerge-7 msgmerge-8 msgmerge-9 msgmerge-10 msgmerge-11 msgmerge-12 \
msgmerge-13 msgmerge-14 msgmerge-15 msgmerge-16 msgmerge-17 \
@@ -54,12 +62,18 @@ TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) PATH=.:../src:$$PATH \
GETTEXT=tstgettext \
NGETTEXT=tstngettext \
XGETTEXT=`echo xgettext|sed '$(transform)'` \
+ MSGATTRIB=`echo msgattrib|sed '$(transform)'` \
MSGCAT=`echo msgcat|sed '$(transform)'` \
MSGCMP=`echo msgcmp|sed '$(transform)'` \
+ MSGCOMM=`echo msgcomm|sed '$(transform)'` \
+ MSGCONV=`echo msgconv|sed '$(transform)'` \
+ MSGEN=`echo msgen|sed '$(transform)'` \
+ MSGEXEC=`echo msgexec|sed '$(transform)'` \
+ MSGFILTER=`echo msgfilter|sed '$(transform)'` \
MSGFMT=`echo msgfmt|sed '$(transform)'` \
+ MSGGREP=`echo msggrep|sed '$(transform)'` \
MSGMERGE=`echo msgmerge|sed '$(transform)'` \
MSGUNFMT=`echo msgunfmt|sed '$(transform)'` \
- MSGCAT=`echo msgcat|sed '$(transform)'` \
MSGUNIQ=`echo msguniq|sed '$(transform)'` \
OBJEXT='@OBJEXT@' EXEEXT='@EXEEXT@' \
LIBTOOL='@LIBTOOL@' \
diff --git a/tests/msgattrib-1 b/tests/msgattrib-1
new file mode 100755
index 0000000..98c3acc
--- /dev/null
+++ b/tests/msgattrib-1
@@ -0,0 +1,103 @@
+#! /bin/sh
+
+# Test --translated option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test1.po"
+cat <<EOF > ma-test1.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test1.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --translated ma-test1.po -o ma-test1.out
+
+tmpfiles="$tmpfiles ma-test1.ok"
+cat <<EOF > ma-test1.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test1.ok ma-test1.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-10 b/tests/msgattrib-10
new file mode 100755
index 0000000..82986c6
--- /dev/null
+++ b/tests/msgattrib-10
@@ -0,0 +1,103 @@
+#! /bin/sh
+
+# Test --set-obsolete option. Note that the output routines drop untranslated
+# obsolete messages. Note also that obsolete messages don't have file locations
+# attached.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test10.po"
+cat <<EOF > ma-test10.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test10.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --set-obsolete ma-test10.po -o ma-test10.out
+
+tmpfiles="$tmpfiles ma-test10.ok"
+cat <<EOF > ma-test10.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#, fuzzy
+#~ msgid "The world is full of married men"
+#~ msgstr "So viele verheiratete Männer"
+
+#~ msgid "with wives who never understand"
+#~ msgstr "und ihre Frauen verstehen sie nicht"
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test10.ok ma-test10.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-11 b/tests/msgattrib-11
new file mode 100755
index 0000000..22a3b3e
--- /dev/null
+++ b/tests/msgattrib-11
@@ -0,0 +1,120 @@
+#! /bin/sh
+
+# Test --clear-obsolete option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test11.po"
+cat <<EOF > ma-test11.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test11.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --clear-obsolete ma-test11.po -o ma-test11.out
+
+tmpfiles="$tmpfiles ma-test11.ok"
+cat <<EOF > ma-test11.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+msgid "You fly on the wings of romance"
+msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+msgid "In the eyes of the world"
+msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+msgid "You're just another crazy girl"
+msgstr "bist du bloß ein verrücktes dummes Ding"
+
+msgid "Who loves a married man"
+msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test11.ok ma-test11.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-12 b/tests/msgattrib-12
new file mode 100755
index 0000000..2fff0ef
--- /dev/null
+++ b/tests/msgattrib-12
@@ -0,0 +1,87 @@
+#! /bin/sh
+
+# Test --fuzzy option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test12.po"
+cat <<EOF > ma-test12.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test12.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --fuzzy ma-test12.po -o ma-test12.out
+
+tmpfiles="$tmpfiles ma-test12.ok"
+cat <<EOF > ma-test12.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test12.ok ma-test12.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-13 b/tests/msgattrib-13
new file mode 100755
index 0000000..b2cff7d
--- /dev/null
+++ b/tests/msgattrib-13
@@ -0,0 +1,94 @@
+#! /bin/sh
+
+# Test --obsolete option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test13.po"
+cat <<EOF > ma-test13.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test13.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --obsolete ma-test13.po -o ma-test13.out
+
+tmpfiles="$tmpfiles ma-test13.ok"
+cat <<EOF > ma-test13.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "You fly on the wings of romance"
+msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+msgid "In the eyes of the world"
+msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+msgid "You're just another crazy girl"
+msgstr "bist du bloß ein verrücktes dummes Ding"
+
+msgid "Who loves a married man"
+msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test13.ok ma-test13.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-14 b/tests/msgattrib-14
new file mode 100755
index 0000000..60e78ef
--- /dev/null
+++ b/tests/msgattrib-14
@@ -0,0 +1,90 @@
+#! /bin/sh
+
+# Test combination of selection and manipulation option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test14.po"
+cat <<EOF > ma-test14.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test14.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --obsolete --no-fuzzy ma-test14.po -o ma-test14.out
+
+tmpfiles="$tmpfiles ma-test14.ok"
+cat <<EOF > ma-test14.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "You fly on the wings of romance"
+msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+# Etwas freie Übersetzung.
+msgid "You're just another crazy girl"
+msgstr "bist du bloß ein verrücktes dummes Ding"
+
+msgid "Who loves a married man"
+msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test14.ok ma-test14.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-2 b/tests/msgattrib-2
new file mode 100755
index 0000000..2f156a1
--- /dev/null
+++ b/tests/msgattrib-2
@@ -0,0 +1,97 @@
+#! /bin/sh
+
+# Test --untranslated option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test2.po"
+cat <<EOF > ma-test2.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test2.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --untranslated ma-test2.po -o ma-test2.out
+
+tmpfiles="$tmpfiles ma-test2.ok"
+cat <<EOF > ma-test2.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test2.ok ma-test2.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-3 b/tests/msgattrib-3
new file mode 100755
index 0000000..b9b5809
--- /dev/null
+++ b/tests/msgattrib-3
@@ -0,0 +1,111 @@
+#! /bin/sh
+
+# Test --no-fuzzy option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test3.po"
+cat <<EOF > ma-test3.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test3.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --no-fuzzy ma-test3.po -o ma-test3.out
+
+tmpfiles="$tmpfiles ma-test3.ok"
+cat <<EOF > ma-test3.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test3.ok ma-test3.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-4 b/tests/msgattrib-4
new file mode 100755
index 0000000..10eb3e9
--- /dev/null
+++ b/tests/msgattrib-4
@@ -0,0 +1,89 @@
+#! /bin/sh
+
+# Test --only-fuzzy option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test4.po"
+cat <<EOF > ma-test4.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test4.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --only-fuzzy ma-test4.po -o ma-test4.out
+
+tmpfiles="$tmpfiles ma-test4.ok"
+cat <<EOF > ma-test4.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test4.ok ma-test4.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-5 b/tests/msgattrib-5
new file mode 100755
index 0000000..46223b2
--- /dev/null
+++ b/tests/msgattrib-5
@@ -0,0 +1,106 @@
+#! /bin/sh
+
+# Test --no-obsolete option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test5.po"
+cat <<EOF > ma-test5.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test5.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --no-obsolete ma-test5.po -o ma-test5.out
+
+tmpfiles="$tmpfiles ma-test5.ok"
+cat <<EOF > ma-test5.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test5.ok ma-test5.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-6 b/tests/msgattrib-6
new file mode 100755
index 0000000..9473978
--- /dev/null
+++ b/tests/msgattrib-6
@@ -0,0 +1,94 @@
+#! /bin/sh
+
+# Test --only-obsolete option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test6.po"
+cat <<EOF > ma-test6.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test6.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --only-obsolete ma-test6.po -o ma-test6.out
+
+tmpfiles="$tmpfiles ma-test6.ok"
+cat <<EOF > ma-test6.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test6.ok ma-test6.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-7 b/tests/msgattrib-7
new file mode 100755
index 0000000..2fa8f1f
--- /dev/null
+++ b/tests/msgattrib-7
@@ -0,0 +1,94 @@
+#! /bin/sh
+
+# Test combination of two selection options.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test7.po"
+cat <<EOF > ma-test7.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test7.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --translated --only-obsolete ma-test7.po -o ma-test7.out
+
+tmpfiles="$tmpfiles ma-test7.ok"
+cat <<EOF > ma-test7.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test7.ok ma-test7.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-8 b/tests/msgattrib-8
new file mode 100755
index 0000000..6564f7c
--- /dev/null
+++ b/tests/msgattrib-8
@@ -0,0 +1,126 @@
+#! /bin/sh
+
+# Test --set-fuzzy option. Note that the output routines ignore the fuzzy
+# attribute for untranslated messages.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test8.po"
+cat <<EOF > ma-test8.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test8.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --set-fuzzy ma-test8.po -o ma-test8.out
+
+tmpfiles="$tmpfiles ma-test8.ok"
+cat <<EOF > ma-test8.ok
+# HEADER.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+#, fuzzy
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#, fuzzy
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#, fuzzy
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#, fuzzy
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test8.ok ma-test8.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgattrib-9 b/tests/msgattrib-9
new file mode 100755
index 0000000..c7e5b09
--- /dev/null
+++ b/tests/msgattrib-9
@@ -0,0 +1,118 @@
+#! /bin/sh
+
+# Test --clear-fuzzy option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles ma-test9.po"
+cat <<EOF > ma-test9.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles ma-test9.out"
+: ${MSGATTRIB=msgattrib}
+${MSGATTRIB} --clear-fuzzy ma-test9.po -o ma-test9.out
+
+tmpfiles="$tmpfiles ma-test9.ok"
+cat <<EOF > ma-test9.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} ma-test9.ok ma-test9.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgconv-1 b/tests/msgconv-1
new file mode 100755
index 0000000..2809106
--- /dev/null
+++ b/tests/msgconv-1
@@ -0,0 +1,49 @@
+#! /bin/sh
+
+# Test conversion from BIG5 to UTF-8.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mco-test1.po"
+cat <<EOF > mco-test1.po
+# Chinese translation for GNU gettext messages.
+#
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=big5\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/msgcmp.c:155 src/msgmerge.c:273
+msgid "exactly 2 input files required"
+msgstr "¦¹¥\¯à»Ý­n«ê¦n«ü©w¨â­Ó¿é¤JÀÉ"
+EOF
+
+tmpfiles="$tmpfiles mco-test1.out"
+: ${MSGCONV=msgconv}
+${MSGCONV} --to-code=UTF-8 mco-test1.po -o mco-test1.out
+
+tmpfiles="$tmpfiles mco-test1.ok"
+cat <<EOF > mco-test1.ok
+# Chinese translation for GNU gettext messages.
+#
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/msgcmp.c:155 src/msgmerge.c:273
+msgid "exactly 2 input files required"
+msgstr "此功能需è¦æ°å¥½æŒ‡å®šå…©å€‹è¼¸å…¥æª”"
+EOF
+
+: ${DIFF=diff}
+# Redirect stdout, so as not to fill the user's screen with non-ASCII bytes.
+${DIFF} mco-test1.ok mco-test1.out >/dev/null
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgconv-2 b/tests/msgconv-2
new file mode 100755
index 0000000..00622ba
--- /dev/null
+++ b/tests/msgconv-2
@@ -0,0 +1,50 @@
+#! /bin/sh
+
+# Test conversion from UTF-8 to BIG5.
+# Test that encoding names are case insensitive.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mco-test2.po"
+cat <<EOF > mco-test2.po
+# Chinese translation for GNU gettext messages.
+#
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/msgcmp.c:155 src/msgmerge.c:273
+msgid "exactly 2 input files required"
+msgstr "此功能需è¦æ°å¥½æŒ‡å®šå…©å€‹è¼¸å…¥æª”"
+EOF
+
+tmpfiles="$tmpfiles mco-test2.out"
+: ${MSGCONV=msgconv}
+${MSGCONV} -t Big5 mco-test2.po -o mco-test2.out
+
+tmpfiles="$tmpfiles mco-test2.ok"
+cat <<EOF > mco-test2.ok
+# Chinese translation for GNU gettext messages.
+#
+msgid ""
+msgstr ""
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=BIG5\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: src/msgcmp.c:155 src/msgmerge.c:273
+msgid "exactly 2 input files required"
+msgstr "¦¹¥\¯à»Ý­n«ê¦n«ü©w¨â­Ó¿é¤JÀÉ"
+EOF
+
+: ${DIFF=diff}
+# Redirect stdout, so as not to fill the user's screen with non-ASCII bytes.
+${DIFF} mco-test2.ok mco-test2.out >/dev/null
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgen-1 b/tests/msgen-1
new file mode 100755
index 0000000..19e53b6
--- /dev/null
+++ b/tests/msgen-1
@@ -0,0 +1,64 @@
+#! /bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles men-test1.po"
+cat <<EOF > men-test1.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "height must be positive"
+msgstr ""
+
+msgid "color cannot be transparent"
+msgstr "colour cannot be transparent"
+
+msgid "width must be positive"
+msgstr ""
+
+msgid "%d error"
+msgid_plural "%d errors"
+msgstr[0] ""
+msgstr[1] ""
+EOF
+
+tmpfiles="$tmpfiles men-test1.out"
+: ${MSGEN=msgen}
+${MSGEN} men-test1.po -o men-test1.out
+
+tmpfiles="$tmpfiles men-test1.ok"
+cat <<EOF > men-test1.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Content-Type: text/plain; charset=ASCII\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+msgid "height must be positive"
+msgstr "height must be positive"
+
+msgid "color cannot be transparent"
+msgstr "colour cannot be transparent"
+
+msgid "width must be positive"
+msgstr "width must be positive"
+
+msgid "%d error"
+msgid_plural "%d errors"
+msgstr[0] "%d error"
+msgstr[1] "%d errors"
+EOF
+
+: ${DIFF=diff}
+${DIFF} men-test1.ok men-test1.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgexec-1 b/tests/msgexec-1
new file mode 100755
index 0000000..fabbcb3
--- /dev/null
+++ b/tests/msgexec-1
@@ -0,0 +1,136 @@
+#! /bin/sh
+
+# Test of an external command.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mex-test1.po"
+cat <<EOF > mex-test1.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe\n"
+#~ "heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles mex-test1.sh"
+cat <<\EOF > mex-test1.sh
+#! /bin/sh
+echo "========================= $MSGEXEC_LOCATION ========================="
+cat <<MEOF
+$MSGEXEC_MSGID
+---
+MEOF
+cat
+echo
+exit 0
+EOF
+chmod a+x mex-test1.sh
+
+tmpfiles="$tmpfiles mex-test1.out"
+: ${MSGEXEC=msgexec}
+${MSGEXEC} -i mex-test1.po ./mex-test1.sh > mex-test1.out
+
+tmpfiles="$tmpfiles mex-test1.ok"
+cat <<EOF > mex-test1.ok
+========================= mex-test1.po:4 =========================
+
+---
+Project-Id-Version: Bonnie Tyler
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+
+========================= mex-test1.po:12 =========================
+The world is full of married men
+---
+So viele verheiratete Männer
+========================= mex-test1.po:16 =========================
+with wives who never understand
+---
+und ihre Frauen verstehen sie nicht
+========================= mex-test1.po:20 =========================
+They're looking for someone to share
+---
+
+========================= mex-test1.po:25 =========================
+the excitement of a love affair
+---
+
+========================= mex-test1.po:29 =========================
+Just as soon as they find you
+---
+
+========================= mex-test1.po:33 =========================
+They warn you and darn you
+---
+
+========================= mex-test1.po:36 =========================
+You fly on the wings of romance
+---
+Die Flügel der frischen Liebe
+heben dich zum Himmel
+========================= mex-test1.po:41 =========================
+In the eyes of the world
+---
+Für die anderen
+========================= mex-test1.po:45 =========================
+You're just another crazy girl
+---
+bist du bloß ein verrücktes dummes Ding
+========================= mex-test1.po:48 =========================
+Who loves a married man
+---
+das einen verheirateten Mann liebt
+EOF
+
+: ${DIFF=diff}
+${DIFF} mex-test1.ok mex-test1.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgexec-2 b/tests/msgexec-2
new file mode 100755
index 0000000..51a28cf
--- /dev/null
+++ b/tests/msgexec-2
@@ -0,0 +1,79 @@
+#! /bin/sh
+
+# Test the builtin command "0".
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mex-test2.po"
+cat <<EOF > mex-test2.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe\n"
+#~ "heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles mex-test2.out"
+: ${MSGEXEC=msgexec}
+(${MSGEXEC} -i mex-test2.po 0 | tr '\000' '@' ; echo) > mex-test2.out
+
+tmpfiles="$tmpfiles mex-test2.ok"
+cat <<EOF > mex-test2.ok
+Project-Id-Version: Bonnie Tyler
+Content-Type: text/plain; charset=ISO-8859-1
+Content-Transfer-Encoding: 8bit
+@So viele verheiratete Männer@und ihre Frauen verstehen sie nicht@@@@@Die Flügel der frischen Liebe
+heben dich zum Himmel@Für die anderen@bist du bloß ein verrücktes dummes Ding@das einen verheirateten Mann liebt@
+EOF
+
+: ${DIFF=diff}
+${DIFF} mex-test2.ok mex-test2.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgfilter-1 b/tests/msgfilter-1
new file mode 100755
index 0000000..bc633fb
--- /dev/null
+++ b/tests/msgfilter-1
@@ -0,0 +1,140 @@
+#! /bin/sh
+
+# Test general filter execution.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mfi-test1.po"
+cat <<EOF > mfi-test1.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles mfi-test1.out"
+: ${MSGFILTER=msgfilter}
+LC_ALL=C \
+${MSGFILTER} -i mfi-test1.po -o mfi-test1.out fold -b -s -w 20 2>&1 \
+ | grep -v 'warning: Locale charset' | grep -v '^ '
+
+tmpfiles="$tmpfiles mfi-test1.ok"
+cat <<EOF > mfi-test1.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: \n"
+"Bonnie Tyler\n"
+"Content-Type: \n"
+"text/plain; \n"
+"charset=ISO-8859-1\n"
+"Content-Transfer-Enc\n"
+"oding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr ""
+"So viele \n"
+"verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr ""
+"und ihre Frauen \n"
+"verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr ""
+#~ "Die Flügel der \n"
+#~ "frischen Liebe \n"
+#~ "heben dich zum \n"
+#~ "Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr ""
+#~ "bist du bloß ein \n"
+#~ "verrücktes dummes \n"
+#~ "Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr ""
+#~ "das einen \n"
+#~ "verheirateten Mann \n"
+#~ "liebt"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mfi-test1.ok mfi-test1.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msgfilter-2 b/tests/msgfilter-2
new file mode 100755
index 0000000..0610675
--- /dev/null
+++ b/tests/msgfilter-2
@@ -0,0 +1,128 @@
+#! /bin/sh
+
+# Test sed execution.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mfi-test2.po"
+cat <<EOF > mfi-test2.po
+# HEADER.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "So viele verheiratete Männer"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "und ihre Frauen verstehen sie nicht"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "Die Flügel der frischen Liebe heben dich zum Himmel"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "Für die anderen"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "bist du bloß ein verrücktes dummes Ding"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "das einen verheirateten Mann liebt"
+EOF
+
+tmpfiles="$tmpfiles mfi-test2.out"
+: ${MSGFILTER=msgfilter}
+sedexpr1='1{
+s/^/\[\[/
+}'
+sedexpr2='${
+s/$/\]\]/
+}'
+LC_ALL=C \
+${MSGFILTER} -i mfi-test2.po -o mfi-test2.out sed -e "$sedexpr1" -e "$sedexpr2" 2>&1 \
+ | grep -v 'warning: Locale charset' | grep -v '^ '
+
+tmpfiles="$tmpfiles mfi-test2.ok"
+cat <<EOF > mfi-test2.ok
+# HEADER.
+#
+msgid ""
+msgstr ""
+"[[Project-Id-Version: Bonnie Tyler\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit]]\n"
+
+#: married-men:4
+#, fuzzy
+msgid "The world is full of married men"
+msgstr "[[So viele verheiratete Männer]]"
+
+#: married-men:5
+msgid "with wives who never understand"
+msgstr "[[und ihre Frauen verstehen sie nicht]]"
+
+#: married-men:6
+msgid "They're looking for someone to share"
+msgstr ""
+
+# schwer zu übersetzen...
+#: married-men:7
+msgid "the excitement of a love affair"
+msgstr ""
+
+#: married-men:8
+msgid "Just as soon as they find you"
+msgstr ""
+
+#: married-men:9
+msgid "They warn you and darn you"
+msgstr ""
+
+#~ msgid "You fly on the wings of romance"
+#~ msgstr "[[Die Flügel der frischen Liebe heben dich zum Himmel]]"
+
+#, fuzzy
+#~ msgid "In the eyes of the world"
+#~ msgstr "[[Für die anderen]]"
+
+# Etwas freie Übersetzung.
+#~ msgid "You're just another crazy girl"
+#~ msgstr "[[bist du bloß ein verrücktes dummes Ding]]"
+
+#~ msgid "Who loves a married man"
+#~ msgstr "[[das einen verheirateten Mann liebt]]"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mfi-test2.ok mfi-test2.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msggrep-1 b/tests/msggrep-1
new file mode 100755
index 0000000..5024cb8
--- /dev/null
+++ b/tests/msggrep-1
@@ -0,0 +1,195 @@
+#! /bin/sh
+
+# Test --location option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mg-test1.po"
+cat <<\EOF > mg-test1.po
+# German translations for GNU gettext package.
+# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.11-pre1\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 2001-11-04 12:25+0100\n"
+"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: argmatch.c:141
+#, c-format
+msgid "invalid argument `%s' for `%s'"
+msgstr "ungültiges Argument »%s« für »%s«"
+
+#: argmatch.c:142
+#, c-format
+msgid "ambiguous argument `%s' for `%s'"
+msgstr "mehrdeutiges Argument »%s« für »%s«"
+
+#: argmatch.c:162
+msgid "Valid arguments are:"
+msgstr "Gültige Argumente sind:"
+
+#: copy-file.c:60
+#, c-format
+msgid "error while opening \"%s\" for reading"
+msgstr "Öffnen der Datei »%s« zum Lesen fehlgeschlagen"
+
+#: copy-file.c:67
+#, c-format
+msgid "cannot open backup file \"%s\" for writing"
+msgstr "Öffnen der Sicherungsdatei »%s« zum Schreiben fehlgeschlagen"
+
+#: copy-file.c:80
+#, c-format
+msgid "error reading \"%s\""
+msgstr "Fehler beim Lesen von »%s«"
+
+#: copy-file.c:86 copy-file.c:90
+#, c-format
+msgid "error writing \"%s\""
+msgstr "Fehler beim Schreiben von »%s«"
+
+#: copy-file.c:92
+#, c-format
+msgid "error after reading \"%s\""
+msgstr "Fehler nach dem Lesen von »%s«"
+
+#: error.c:115
+msgid "Unknown system error"
+msgstr "Unbekannter Systemfehler"
+
+#: execute.c:170 execute.c:205 pipe-bidi.c:156 pipe-bidi.c:191 pipe-in.c:169
+#: pipe-in.c:205 pipe-out.c:169 pipe-out.c:205 wait-process.c:136
+#, c-format
+msgid "%s subprocess failed"
+msgstr "Subprozess %s fehlgeschlagen"
+
+#: getopt.c:691
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: Option »%s« ist mehrdeutig\n"
+
+#: getopt.c:716
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: Option »--%s« erwartet kein Argument\n"
+
+#: getopt.c:721
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: Option »%c%s« erwartet kein Argument\n"
+
+#: getopt.c:739 getopt.c:912
+#, c-format
+msgid "%s: option `%s' requires an argument\n"
+msgstr "%s: Option »%s« erwartet ein Argument\n"
+
+#: getopt.c:768
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: unbekannte Option »--%s«\n"
+
+#: getopt.c:772
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: unbekannte Option »%c%s«\n"
+
+#: getopt.c:798
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: unzulässige Option -- %c\n"
+
+#: getopt.c:801
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: ungültige Option -- %c\n"
+
+#: getopt.c:831 getopt.c:961
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: Option erwartet ein Argument -- %c\n"
+
+#: getopt.c:878
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: Option »-W %s« ist mehrdeutig\n"
+
+#: getopt.c:896
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: Option »-W %s« erwartet kein Argument\n"
+
+#: javacomp.c:465
+msgid "Java compiler not found, try installing gcj or set $JAVAC"
+msgstr ""
+"Java-Compiler nicht gefunden; bitte »gcj« installieren oder $JAVAC setzen"
+
+#: javaexec.c:404
+msgid "Java virtual machine not found, try installing gij or set $JAVA"
+msgstr ""
+"Virtuelle Java-Maschine nicht gefunden; bitte »gcj« installieren oder\n"
+"$JAVA setzen"
+
+#: obstack.c:474 xerror.c:75 xmalloc.c:56
+msgid "memory exhausted"
+msgstr "virtueller Speicher erschöpft"
+
+#: pipe-bidi.c:119 pipe-bidi.c:121 pipe-in.c:136 pipe-out.c:136
+msgid "cannot create pipe"
+msgstr "Es ist nicht möglich, eine Pipe zu erzeugen"
+
+#: wait-process.c:117
+#, c-format
+msgid "%s subprocess"
+msgstr "Subprozess %s"
+
+#: wait-process.c:129
+#, c-format
+msgid "%s subprocess got fatal signal"
+msgstr "Subprozess %s hat ein fatales Signal erhalten"
+EOF
+
+tmpfiles="$tmpfiles mg-test1.out"
+: ${MSGGREP=msggrep}
+${MSGGREP} -N pipe-bidi.c mg-test1.po -o mg-test1.out
+
+tmpfiles="$tmpfiles mg-test1.ok"
+cat <<\EOF > mg-test1.ok
+# German translations for GNU gettext package.
+# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.11-pre1\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 2001-11-04 12:25+0100\n"
+"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: execute.c:170 execute.c:205 pipe-bidi.c:156 pipe-bidi.c:191 pipe-in.c:169
+#: pipe-in.c:205 pipe-out.c:169 pipe-out.c:205 wait-process.c:136
+#, c-format
+msgid "%s subprocess failed"
+msgstr "Subprozess %s fehlgeschlagen"
+
+#: pipe-bidi.c:119 pipe-bidi.c:121 pipe-in.c:136 pipe-out.c:136
+msgid "cannot create pipe"
+msgstr "Es ist nicht möglich, eine Pipe zu erzeugen"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mg-test1.ok mg-test1.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msggrep-2 b/tests/msggrep-2
new file mode 100755
index 0000000..b10c3ff
--- /dev/null
+++ b/tests/msggrep-2
@@ -0,0 +1,257 @@
+#! /bin/sh
+
+# Test --domain option.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mg-test2.po"
+cat <<\EOF > mg-test2.po
+domain "de"
+
+# German translations for GNU gettext package.
+# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.11-pre1\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 2001-11-04 12:25+0100\n"
+"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: getopt.c:691
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: Option »%s« ist mehrdeutig\n"
+
+#: getopt.c:716
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: Option »--%s« erwartet kein Argument\n"
+
+#: getopt.c:721
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: Option »%c%s« erwartet kein Argument\n"
+
+#: getopt.c:739 getopt.c:912
+#, c-format
+msgid "%s: option `%s' requires an argument\n"
+msgstr "%s: Option »%s« erwartet ein Argument\n"
+
+#: getopt.c:768
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: unbekannte Option »--%s«\n"
+
+#: getopt.c:772
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: unbekannte Option »%c%s«\n"
+
+#: getopt.c:798
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: unzulässige Option -- %c\n"
+
+#: getopt.c:801
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: ungültige Option -- %c\n"
+
+#: getopt.c:831 getopt.c:961
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: Option erwartet ein Argument -- %c\n"
+
+#: getopt.c:878
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: Option »-W %s« ist mehrdeutig\n"
+
+#: getopt.c:896
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: Option »-W %s« erwartet kein Argument\n"
+
+domain "fr"
+
+# Messages français pour GNU gettext.
+# Copyright © 1996, 1997, 1998 Free Software Foundation, Inc.
+# François Pinard <pinard@iro.umontreal.ca>, 1996.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.10.35\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 1998-05-04 10:03-04:00\n"
+"Last-Translator: François Pinard <pinard@iro.umontreal.ca>\n"
+"Language-Team: French <fr@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: getopt.c:691
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: l'option « %s » est ambiguë\n"
+
+#: getopt.c:716
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: l'option « --%s » ne tolère pas d'argument\n"
+
+#: getopt.c:721
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: l'option « %c%s » ne tolère pas d'argument\n"
+
+#: getopt.c:739 getopt.c:912
+#, c-format
+msgid "%s: option `%s' requires an argument\n"
+msgstr "%s: l'option « %s » exige un argument\n"
+
+#: getopt.c:768
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: l'option « --%s » n'est pas reconnue\n"
+
+#: getopt.c:772
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: l'option « %c%s » n'est pas reconnue\n"
+
+#: getopt.c:798
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: l'option « %c » n'est pas permise\n"
+
+#: getopt.c:801
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: l'option « %c » n'est pas valide\n"
+
+#: getopt.c:831 getopt.c:961
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: l'option « %c » exige un argument\n"
+
+#: getopt.c:878
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: l'option « -W %s » est ambiguë\n"
+
+#: getopt.c:896
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: l'option « -W %s » ne tolère pas d'argument\n"
+EOF
+
+tmpfiles="$tmpfiles mg-test2.out"
+: ${MSGGREP=msggrep}
+${MSGGREP} -M fr mg-test2.po -o mg-test2.out
+
+tmpfiles="$tmpfiles mg-test2.ok"
+cat <<\EOF > mg-test2.ok
+domain "de"
+
+# German translations for GNU gettext package.
+# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.11-pre1\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 2001-11-04 12:25+0100\n"
+"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+domain "fr"
+
+# Messages français pour GNU gettext.
+# Copyright © 1996, 1997, 1998 Free Software Foundation, Inc.
+# François Pinard <pinard@iro.umontreal.ca>, 1996.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.10.35\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 1998-05-04 10:03-04:00\n"
+"Last-Translator: François Pinard <pinard@iro.umontreal.ca>\n"
+"Language-Team: French <fr@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: getopt.c:691
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: l'option « %s » est ambiguë\n"
+
+#: getopt.c:716
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: l'option « --%s » ne tolère pas d'argument\n"
+
+#: getopt.c:721
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: l'option « %c%s » ne tolère pas d'argument\n"
+
+#: getopt.c:739 getopt.c:912
+#, c-format
+msgid "%s: option `%s' requires an argument\n"
+msgstr "%s: l'option « %s » exige un argument\n"
+
+#: getopt.c:768
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: l'option « --%s » n'est pas reconnue\n"
+
+#: getopt.c:772
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: l'option « %c%s » n'est pas reconnue\n"
+
+#: getopt.c:798
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: l'option « %c » n'est pas permise\n"
+
+#: getopt.c:801
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: l'option « %c » n'est pas valide\n"
+
+#: getopt.c:831 getopt.c:961
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: l'option « %c » exige un argument\n"
+
+#: getopt.c:878
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: l'option « -W %s » est ambiguë\n"
+
+#: getopt.c:896
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: l'option « -W %s » ne tolère pas d'argument\n"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mg-test2.ok mg-test2.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msggrep-3 b/tests/msggrep-3
new file mode 100755
index 0000000..2cb996d
--- /dev/null
+++ b/tests/msggrep-3
@@ -0,0 +1,219 @@
+#! /bin/sh
+
+# Test --msgid and --msgstr options.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mg-test3.po"
+cat <<\EOF > mg-test3.po
+# German translations for GNU gettext package.
+# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.11-pre1\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 2001-11-04 12:25+0100\n"
+"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: argmatch.c:141
+#, c-format
+msgid "invalid argument `%s' for `%s'"
+msgstr "ungültiges Argument »%s« für »%s«"
+
+#: argmatch.c:142
+#, c-format
+msgid "ambiguous argument `%s' for `%s'"
+msgstr "mehrdeutiges Argument »%s« für »%s«"
+
+#: argmatch.c:162
+msgid "Valid arguments are:"
+msgstr "Gültige Argumente sind:"
+
+#: copy-file.c:60
+#, c-format
+msgid "error while opening \"%s\" for reading"
+msgstr "Öffnen der Datei »%s« zum Lesen fehlgeschlagen"
+
+#: copy-file.c:67
+#, c-format
+msgid "cannot open backup file \"%s\" for writing"
+msgstr "Öffnen der Sicherungsdatei »%s« zum Schreiben fehlgeschlagen"
+
+#: copy-file.c:80
+#, c-format
+msgid "error reading \"%s\""
+msgstr "Fehler beim Lesen von »%s«"
+
+#: copy-file.c:86 copy-file.c:90
+#, c-format
+msgid "error writing \"%s\""
+msgstr "Fehler beim Schreiben von »%s«"
+
+#: copy-file.c:92
+#, c-format
+msgid "error after reading \"%s\""
+msgstr "Fehler nach dem Lesen von »%s«"
+
+#: error.c:115
+msgid "Unknown system error"
+msgstr "Unbekannter Systemfehler"
+
+#: execute.c:170 execute.c:205 pipe-bidi.c:156 pipe-bidi.c:191 pipe-in.c:169
+#: pipe-in.c:205 pipe-out.c:169 pipe-out.c:205 wait-process.c:136
+#, c-format
+msgid "%s subprocess failed"
+msgstr "Subprozess %s fehlgeschlagen"
+
+#: getopt.c:691
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: Option »%s« ist mehrdeutig\n"
+
+#: getopt.c:716
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: Option »--%s« erwartet kein Argument\n"
+
+#: getopt.c:721
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: Option »%c%s« erwartet kein Argument\n"
+
+#: getopt.c:739 getopt.c:912
+#, c-format
+msgid "%s: option `%s' requires an argument\n"
+msgstr "%s: Option »%s« erwartet ein Argument\n"
+
+#: getopt.c:768
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: unbekannte Option »--%s«\n"
+
+#: getopt.c:772
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: unbekannte Option »%c%s«\n"
+
+#: getopt.c:798
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: unzulässige Option -- %c\n"
+
+#: getopt.c:801
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: ungültige Option -- %c\n"
+
+#: getopt.c:831 getopt.c:961
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: Option erwartet ein Argument -- %c\n"
+
+#: getopt.c:878
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: Option »-W %s« ist mehrdeutig\n"
+
+#: getopt.c:896
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: Option »-W %s« erwartet kein Argument\n"
+
+#: javacomp.c:465
+msgid "Java compiler not found, try installing gcj or set $JAVAC"
+msgstr ""
+"Java-Compiler nicht gefunden; bitte »gcj« installieren oder $JAVAC setzen"
+
+#: javaexec.c:404
+msgid "Java virtual machine not found, try installing gij or set $JAVA"
+msgstr ""
+"Virtuelle Java-Maschine nicht gefunden; bitte »gcj« installieren oder\n"
+"$JAVA setzen"
+
+#: obstack.c:474 xerror.c:75 xmalloc.c:56
+msgid "memory exhausted"
+msgstr "virtueller Speicher erschöpft"
+
+#: pipe-bidi.c:119 pipe-bidi.c:121 pipe-in.c:136 pipe-out.c:136
+msgid "cannot create pipe"
+msgstr "Es ist nicht möglich, eine Pipe zu erzeugen"
+
+#: wait-process.c:117
+#, c-format
+msgid "%s subprocess"
+msgstr "Subprozess %s"
+
+#: wait-process.c:129
+#, c-format
+msgid "%s subprocess got fatal signal"
+msgstr "Subprozess %s hat ein fatales Signal erhalten"
+
+# A pattern specified for the msgid only must not be matched with the msgstr.
+msgid "GSG-9"
+msgstr "Antiterror-Einheit"
+EOF
+
+tmpfiles="$tmpfiles mg-test3.out"
+: ${MSGGREP=msggrep}
+LC_MESSAGES=C LC_ALL= \
+${MSGGREP} -K -e error -T -e Speicher mg-test3.po -o mg-test3.out 2>&1 \
+ | grep -v 'warning: Locale charset' | grep -v '^ '
+
+tmpfiles="$tmpfiles mg-test3.ok"
+cat <<\EOF > mg-test3.ok
+# German translations for GNU gettext package.
+# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.11-pre1\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 2001-11-04 12:25+0100\n"
+"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: copy-file.c:60
+#, c-format
+msgid "error while opening \"%s\" for reading"
+msgstr "Öffnen der Datei »%s« zum Lesen fehlgeschlagen"
+
+#: copy-file.c:80
+#, c-format
+msgid "error reading \"%s\""
+msgstr "Fehler beim Lesen von »%s«"
+
+#: copy-file.c:86 copy-file.c:90
+#, c-format
+msgid "error writing \"%s\""
+msgstr "Fehler beim Schreiben von »%s«"
+
+#: copy-file.c:92
+#, c-format
+msgid "error after reading \"%s\""
+msgstr "Fehler nach dem Lesen von »%s«"
+
+#: error.c:115
+msgid "Unknown system error"
+msgstr "Unbekannter Systemfehler"
+
+#: obstack.c:474 xerror.c:75 xmalloc.c:56
+msgid "memory exhausted"
+msgstr "virtueller Speicher erschöpft"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mg-test3.ok mg-test3.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
diff --git a/tests/msggrep-4 b/tests/msggrep-4
new file mode 100755
index 0000000..b7ac532
--- /dev/null
+++ b/tests/msggrep-4
@@ -0,0 +1,243 @@
+#! /bin/sh
+
+# Test multiple -e and multiple -f options.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles mg-test4.po"
+cat <<\EOF > mg-test4.po
+# German translations for GNU gettext package.
+# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.11-pre1\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 2001-11-04 12:25+0100\n"
+"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: argmatch.c:141
+#, c-format
+msgid "invalid argument `%s' for `%s'"
+msgstr "ungültiges Argument »%s« für »%s«"
+
+#: argmatch.c:142
+#, c-format
+msgid "ambiguous argument `%s' for `%s'"
+msgstr "mehrdeutiges Argument »%s« für »%s«"
+
+#: argmatch.c:162
+msgid "Valid arguments are:"
+msgstr "Gültige Argumente sind:"
+
+#: copy-file.c:60
+#, c-format
+msgid "error while opening \"%s\" for reading"
+msgstr "Öffnen der Datei »%s« zum Lesen fehlgeschlagen"
+
+#: copy-file.c:67
+#, c-format
+msgid "cannot open backup file \"%s\" for writing"
+msgstr "Öffnen der Sicherungsdatei »%s« zum Schreiben fehlgeschlagen"
+
+#: copy-file.c:80
+#, c-format
+msgid "error reading \"%s\""
+msgstr "Fehler beim Lesen von »%s«"
+
+#: copy-file.c:86 copy-file.c:90
+#, c-format
+msgid "error writing \"%s\""
+msgstr "Fehler beim Schreiben von »%s«"
+
+#: copy-file.c:92
+#, c-format
+msgid "error after reading \"%s\""
+msgstr "Fehler nach dem Lesen von »%s«"
+
+#: error.c:115
+msgid "Unknown system error"
+msgstr "Unbekannter Systemfehler"
+
+#: execute.c:170 execute.c:205 pipe-bidi.c:156 pipe-bidi.c:191 pipe-in.c:169
+#: pipe-in.c:205 pipe-out.c:169 pipe-out.c:205 wait-process.c:136
+#, c-format
+msgid "%s subprocess failed"
+msgstr "Subprozess %s fehlgeschlagen"
+
+#: getopt.c:691
+#, c-format
+msgid "%s: option `%s' is ambiguous\n"
+msgstr "%s: Option »%s« ist mehrdeutig\n"
+
+#: getopt.c:716
+#, c-format
+msgid "%s: option `--%s' doesn't allow an argument\n"
+msgstr "%s: Option »--%s« erwartet kein Argument\n"
+
+#: getopt.c:721
+#, c-format
+msgid "%s: option `%c%s' doesn't allow an argument\n"
+msgstr "%s: Option »%c%s« erwartet kein Argument\n"
+
+#: getopt.c:739 getopt.c:912
+#, c-format
+msgid "%s: option `%s' requires an argument\n"
+msgstr "%s: Option »%s« erwartet ein Argument\n"
+
+#: getopt.c:768
+#, c-format
+msgid "%s: unrecognized option `--%s'\n"
+msgstr "%s: unbekannte Option »--%s«\n"
+
+#: getopt.c:772
+#, c-format
+msgid "%s: unrecognized option `%c%s'\n"
+msgstr "%s: unbekannte Option »%c%s«\n"
+
+#: getopt.c:798
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: unzulässige Option -- %c\n"
+
+#: getopt.c:801
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: ungültige Option -- %c\n"
+
+#: getopt.c:831 getopt.c:961
+#, c-format
+msgid "%s: option requires an argument -- %c\n"
+msgstr "%s: Option erwartet ein Argument -- %c\n"
+
+#: getopt.c:878
+#, c-format
+msgid "%s: option `-W %s' is ambiguous\n"
+msgstr "%s: Option »-W %s« ist mehrdeutig\n"
+
+#: getopt.c:896
+#, c-format
+msgid "%s: option `-W %s' doesn't allow an argument\n"
+msgstr "%s: Option »-W %s« erwartet kein Argument\n"
+
+#: javacomp.c:465
+msgid "Java compiler not found, try installing gcj or set $JAVAC"
+msgstr ""
+"Java-Compiler nicht gefunden; bitte »gcj« installieren oder $JAVAC setzen"
+
+#: javaexec.c:404
+msgid "Java virtual machine not found, try installing gij or set $JAVA"
+msgstr ""
+"Virtuelle Java-Maschine nicht gefunden; bitte »gcj« installieren oder\n"
+"$JAVA setzen"
+
+#: obstack.c:474 xerror.c:75 xmalloc.c:56
+msgid "memory exhausted"
+msgstr "virtueller Speicher erschöpft"
+
+#: pipe-bidi.c:119 pipe-bidi.c:121 pipe-in.c:136 pipe-out.c:136
+msgid "cannot create pipe"
+msgstr "Es ist nicht möglich, eine Pipe zu erzeugen"
+
+#: wait-process.c:117
+#, c-format
+msgid "%s subprocess"
+msgstr "Subprozess %s"
+
+#: wait-process.c:129
+#, c-format
+msgid "%s subprocess got fatal signal"
+msgstr "Subprozess %s hat ein fatales Signal erhalten"
+EOF
+
+tmpfiles="$tmpfiles mg-test4.in1"
+echo 'invalid' > mg-test4.in1
+
+tmpfiles="$tmpfiles mg-test4.in2"
+echo 'illegal' > mg-test4.in2
+
+tmpfiles="$tmpfiles mg-test4.out"
+
+tmpfiles="$tmpfiles mg-test4.out"
+: ${MSGGREP=msggrep}
+LC_MESSAGES=C LC_ALL= \
+${MSGGREP} -K -e error -f mg-test4.in1 -f mg-test4.in2 -e cannot mg-test4.po -o mg-test4.out 2>&1 \
+ | grep -v 'warning: Locale charset' | grep -v '^ '
+
+tmpfiles="$tmpfiles mg-test4.ok"
+cat <<\EOF > mg-test4.ok
+# German translations for GNU gettext package.
+# Copyright (C) 1995, 1996, 1997, 2001 Free Software Foundation, Inc.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU gettext 0.11-pre1\n"
+"POT-Creation-Date: 2001-12-08 20:33+0100\n"
+"PO-Revision-Date: 2001-11-04 12:25+0100\n"
+"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"Language-Team: German <de@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: argmatch.c:141
+#, c-format
+msgid "invalid argument `%s' for `%s'"
+msgstr "ungültiges Argument »%s« für »%s«"
+
+#: copy-file.c:60
+#, c-format
+msgid "error while opening \"%s\" for reading"
+msgstr "Öffnen der Datei »%s« zum Lesen fehlgeschlagen"
+
+#: copy-file.c:67
+#, c-format
+msgid "cannot open backup file \"%s\" for writing"
+msgstr "Öffnen der Sicherungsdatei »%s« zum Schreiben fehlgeschlagen"
+
+#: copy-file.c:80
+#, c-format
+msgid "error reading \"%s\""
+msgstr "Fehler beim Lesen von »%s«"
+
+#: copy-file.c:86 copy-file.c:90
+#, c-format
+msgid "error writing \"%s\""
+msgstr "Fehler beim Schreiben von »%s«"
+
+#: copy-file.c:92
+#, c-format
+msgid "error after reading \"%s\""
+msgstr "Fehler nach dem Lesen von »%s«"
+
+#: error.c:115
+msgid "Unknown system error"
+msgstr "Unbekannter Systemfehler"
+
+#: getopt.c:798
+#, c-format
+msgid "%s: illegal option -- %c\n"
+msgstr "%s: unzulässige Option -- %c\n"
+
+#: getopt.c:801
+#, c-format
+msgid "%s: invalid option -- %c\n"
+msgstr "%s: ungültige Option -- %c\n"
+
+#: pipe-bidi.c:119 pipe-bidi.c:121 pipe-in.c:136 pipe-out.c:136
+msgid "cannot create pipe"
+msgstr "Es ist nicht möglich, eine Pipe zu erzeugen"
+EOF
+
+: ${DIFF=diff}
+${DIFF} mg-test4.ok mg-test4.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result