From: Bruno Haible Date: Wed, 2 May 2001 22:00:59 +0000 (+0000) Subject: New tests, from Karl Eichwalder. X-Git-Tag: v0.11~739 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80e44904a6eabf2530b99a0c863610e2d22c1a76;p=thirdparty%2Fgettext.git New tests, from Karl Eichwalder. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index 8481bdd6f..91e0ba71c 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,31 @@ +2001-05-02 Bruno Haible + + * msgcomm-16: Change expected result. + * Makefile.am (TESTS): Add the new tests. + +2001-05-02 Karl Eichwalder + + * msgmerge-6: New file. + * msgmerge-7: New file. + * msgmerge-8: New file. + * msgmerge-9: New file. + * msgcomm-1: New file. + * msgcomm-2: New file. + * msgcomm-3: New file. + * msgcomm-4: New file. + * msgcomm-5: New file. + * msgcomm-6: New file. + * msgcomm-7: New file. + * msgcomm-8: New file. + * msgcomm-9: New file. + * msgcomm-10: New file. + * msgcomm-11: New file. + * msgcomm-12: New file. + * msgcomm-13: New file. + * msgcomm-14: New file. + * msgcomm-15: New file. + * msgcomm-16: New file. + 2001-04-28 Bruno Haible * xg-test1.ok.po: Regenerated. diff --git a/tests/msgcomm-1 b/tests/msgcomm-1 new file mode 100755 index 000000000..542ebb411 --- /dev/null +++ b/tests/msgcomm-1 @@ -0,0 +1,42 @@ +#! /bin/sh + +# Test --more-than=0 option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test1.in1 mcomm-test1.in2" +cat < mcomm-test1.in1 +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test1.in2 +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +tmpfiles="$tmpfiles mcomm-test1.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 -o mcomm-test1.out mcomm-test1.in1 mcomm-test1.in2 + +tmpfiles="$tmpfiles mcomm-test1.ok" +cat << EOF > mcomm-test1.ok +#: first.c:123 +msgid "1" +msgstr "1x" + +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test1.ok mcomm-test1.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-10 b/tests/msgcomm-10 new file mode 100755 index 000000000..98aff4d15 --- /dev/null +++ b/tests/msgcomm-10 @@ -0,0 +1,60 @@ +#! /bin/sh + +# Test merge of common entries with --more-than=1 and --omit-header. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test10.in1 mcomm-test10.in2" +cat < mcomm-test10.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test10.in2 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:759 +msgid "1" +msgstr "" +EOF + +tmpfiles="$tmpfiles mcomm-test10.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=1 --no-location --omit-header -o mcomm-test10.out \ + mcomm-test10.in1 mcomm-test10.in2 + +tmpfiles="$tmpfiles mcomm-test10.ok" +cat << EOF > mcomm-test10.ok +msgid "1" +msgstr "1x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test10.ok mcomm-test10.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-11 b/tests/msgcomm-11 new file mode 100755 index 000000000..102bd759b --- /dev/null +++ b/tests/msgcomm-11 @@ -0,0 +1,64 @@ +#! /bin/sh + +# Test that --more-than=1 drops entries which occur only once. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test11.in1 mcomm-test11.in2" +cat < mcomm-test11.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" + +#: first.c:123 +msgid "2" +msgstr "2x" +EOF + +cat < mcomm-test11.in2 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:759 +msgid "1" +msgstr "" +EOF + +tmpfiles="$tmpfiles mcomm-test11.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=1 --no-location --omit-header -o mcomm-test11.out \ + mcomm-test11.in1 mcomm-test11.in2 + +tmpfiles="$tmpfiles mcomm-test11.ok" +cat << EOF > mcomm-test11.ok +msgid "1" +msgstr "1x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test11.ok mcomm-test11.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-12 b/tests/msgcomm-12 new file mode 100755 index 000000000..e148fe7da --- /dev/null +++ b/tests/msgcomm-12 @@ -0,0 +1,87 @@ +#! /bin/sh + +# Test that --less-than=2 removes entries which occur twice and keeps entries +# which occur only once. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# unique msg in in3 + +tmpfiles="mcomm-test12.in1 mcomm-test12.in2 mcomm-test12.in3" +cat < mcomm-test12.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +# duplicate (cf. in2) +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test12.in2 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +# duplicate (cf. in1) +#: hunt.c:759 +msgid "1" +msgstr "" +EOF + +cat < mcomm-test12.in3 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +# unique +#: hunt.c:890 +msgid "2" +msgstr "" +EOF + +tmpfiles="$tmpfiles mcomm-test12.out" +: ${MSGCOMM=msgcomm} + +# --unique is shorthand for --less-than=2; do we've to test both +# switches? Are 'for' loops allowed? -ke- +${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test12.out \ + mcomm-test12.in1 mcomm-test12.in2 mcomm-test12.in3 + +tmpfiles="$tmpfiles mcomm-test12.ok" +cat << EOF > mcomm-test12.ok +# unique +msgid "2" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test12.ok mcomm-test12.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-13 b/tests/msgcomm-13 new file mode 100755 index 000000000..147331db1 --- /dev/null +++ b/tests/msgcomm-13 @@ -0,0 +1,90 @@ +#! /bin/sh + +# Test that --less-than=2 removes entries which occur more than twice. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# one msg occurs 3 times (has to go away). +# An unique msg in in3 has to stay. + +tmpfiles="mcomm-test13.in1 mcomm-test13.in2 mcomm-test13.in3" +cat < mcomm-test13.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +# occurs 3 times +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test13.in2 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:759 +msgid "1" +msgstr "" +EOF + +cat < mcomm-test13.in3 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:789 +msgid "1" +msgstr "" + +# unique +#: hunt.c:890 +msgid "2" +msgstr "" +EOF + +tmpfiles="$tmpfiles mcomm-test13.out" +: ${MSGCOMM=msgcomm} + +# --unique is shorthand for --less-than=2; do we've to test both +# switches? Are 'for' loops allowed? -ke- +${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test13.out \ + mcomm-test13.in1 mcomm-test13.in2 mcomm-test13.in3 + +tmpfiles="$tmpfiles mcomm-test13.ok" +cat << EOF > mcomm-test13.ok +# unique +msgid "2" +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test13.ok mcomm-test13.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-14 b/tests/msgcomm-14 new file mode 100755 index 000000000..02ed2a229 --- /dev/null +++ b/tests/msgcomm-14 @@ -0,0 +1,82 @@ +#! /bin/sh + +# Test --force-po option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# no unique msg in input files. +# without --force-po don't create any PO file; cf. msgcomm-15 + +tmpfiles="mcomm-test14.in1 mcomm-test14.in2 mcomm-test14.in3" +cat < mcomm-test14.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +# occurs 3 times +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test14.in2 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:759 +msgid "1" +msgstr "" +EOF + +cat < mcomm-test14.in3 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:789 +msgid "1" +msgstr "" +EOF + +tmpfiles="$tmpfiles mcomm-test14.out" +: ${MSGCOMM=msgcomm} + +# --unique is shorthand for --less-than=2; do we've to test both +# switches? Are 'for' loops allowed? -ke- +${MSGCOMM} --less-than=2 --no-location --force-po -o mcomm-test14.out \ + mcomm-test14.in1 mcomm-test14.in2 mcomm-test14.in3 + +tmpfiles="$tmpfiles mcomm-test14.ok" +cat << EOF > mcomm-test14.ok +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test14.ok mcomm-test14.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-15 b/tests/msgcomm-15 new file mode 100755 index 000000000..826469e22 --- /dev/null +++ b/tests/msgcomm-15 @@ -0,0 +1,85 @@ +#! /bin/sh + +# Test that without --force-po option, a PO file without translations is +# not created. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# no unique msg in input files. +# with --force-po create an empty PO file; cf. msgcomm-14 + +tmpfiles="mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3" +cat < mcomm-test15.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +# occurs 3 times +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test15.in2 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:759 +msgid "1" +msgstr "" +EOF + +cat < mcomm-test15.in3 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:789 +msgid "1" +msgstr "" +EOF + +tmpfiles="$tmpfiles mcomm-test15.out" +rm -f mcomm-test15.out + +: ${MSGCOMM=msgcomm} + +# --unique is shorthand for --less-than=2; do we've to test both +# switches? Are 'for' loops allowed? -ke- +${MSGCOMM} --less-than=2 --no-location -o mcomm-test15.out \ + mcomm-test15.in1 mcomm-test15.in2 mcomm-test15.in3 + +# we've no unique msg; thus no PO should be created. +if test -e mcomm-test15.out; then + echo "mcomm-test15.out wrongly written." + result=1 +else + result=0 +fi + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-16 b/tests/msgcomm-16 new file mode 100755 index 000000000..f61569be0 --- /dev/null +++ b/tests/msgcomm-16 @@ -0,0 +1,99 @@ +#! /bin/sh + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +# no unique msg in input files. +# with --force-po create an empty PO file; cf. msgcomm-14 + +tmpfiles="mcomm-test16.in1 mcomm-test16.in2" +cat < mcomm-test16.in1 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "" +"Congratulations!" +msgstr "" +"Glückwunsch!" +EOF + +cat < mcomm-test16.in2 +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Remind user of the login name he chose +#: clients/inst_ask_config.ycp:72 +#, ycp-format +msgid "You can log in as \"%1\"." +msgstr "Sie können sich als \"%1\" einloggen." +EOF + +tmpfiles="$tmpfiles mcomm-test16.out" +rm -f mcomm-test16.out + +: ${MSGCOMM=msgcomm} + +${MSGCOMM} --more-than=0 -o mcomm-test16.out \ + mcomm-test16.in1 mcomm-test16.in2 + +tmpfiles="$tmpfiles mcomm-test16.ok" +cat << EOF > mcomm-test16.ok +# German message file for xyz. +# Copyright (C) 1999, 2000, 2001 xyz. +# Kab Def , 2000. +# +msgid "" +msgstr "" +"Project-Id-Version: xyz\n" +"POT-Creation-Date: 2001-04-24 12:51:34+0200\n" +"PO-Revision-Date: 2001-04-24 13:02+02:00\n" +"Last-Translator: Kab Def \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Help text (HTML-like) START +#: clients/inst_ask_config.ycp:119 +msgid "Congratulations!" +msgstr "Glückwunsch!" + +#. Remind user of the login name he chose +#: clients/inst_ask_config.ycp:72 +msgid "You can log in as \"%1\"." +msgstr "Sie können sich als \"%1\" einloggen." +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test16.ok mcomm-test16.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-2 b/tests/msgcomm-2 new file mode 100755 index 000000000..736480647 --- /dev/null +++ b/tests/msgcomm-2 @@ -0,0 +1,41 @@ +#! /bin/sh + +# Test --no-location option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test2.in1 mcomm-test2.in2" +cat < mcomm-test2.in1 +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test2.in2 +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +tmpfiles="$tmpfiles mcomm-test2.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 --no-location -o mcomm-test2.out \ + mcomm-test2.in1 mcomm-test2.in2 + +tmpfiles="$tmpfiles mcomm-test2.ok" +cat << EOF > mcomm-test2.ok +msgid "1" +msgstr "1x" + +msgid "2" +msgstr "2x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test2.ok mcomm-test2.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-3 b/tests/msgcomm-3 new file mode 100755 index 000000000..aec22d021 --- /dev/null +++ b/tests/msgcomm-3 @@ -0,0 +1,43 @@ +#! /bin/sh + +# Test --omit-header option when there is no header. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test3.in1 mcomm-test3.in2" +cat < mcomm-test3.in1 +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test3.in2 +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +tmpfiles="$tmpfiles mcomm-test3.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 --omit-header -o mcomm-test3.out \ + mcomm-test3.in1 mcomm-test3.in2 + +tmpfiles="$tmpfiles mcomm-test3.ok" +cat << EOF > mcomm-test3.ok +#: first.c:123 +msgid "1" +msgstr "1x" + +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test3.ok mcomm-test3.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-4 b/tests/msgcomm-4 new file mode 100755 index 000000000..7a5f39359 --- /dev/null +++ b/tests/msgcomm-4 @@ -0,0 +1,65 @@ +#! /bin/sh + +# Test what happens with the header entry. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test4.in1 mcomm-test4.in2" +cat < mcomm-test4.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test4.in2 +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +tmpfiles="$tmpfiles mcomm-test4.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 -o mcomm-test4.out \ + mcomm-test4.in1 mcomm-test4.in2 + +tmpfiles="$tmpfiles mcomm-test4.ok" +cat << EOF > mcomm-test4.ok +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" + +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test4.ok mcomm-test4.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-5 b/tests/msgcomm-5 new file mode 100755 index 000000000..1a0b38069 --- /dev/null +++ b/tests/msgcomm-5 @@ -0,0 +1,54 @@ +#! /bin/sh + +# Test --omit-header option when there is a header. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test5.in1 mcomm-test5.in2" +cat < mcomm-test5.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test5.in2 +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +tmpfiles="$tmpfiles mcomm-test5.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 --omit-header -o mcomm-test5.out \ + mcomm-test5.in1 mcomm-test5.in2 + +tmpfiles="$tmpfiles mcomm-test5.ok" +cat << EOF > mcomm-test5.ok +#: first.c:123 +msgid "1" +msgstr "1x" + +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test5.ok mcomm-test5.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-6 b/tests/msgcomm-6 new file mode 100755 index 000000000..cf4e03100 --- /dev/null +++ b/tests/msgcomm-6 @@ -0,0 +1,63 @@ +#! /bin/sh + +# Test --no-location option when there is a header. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test6.in1 mcomm-test6.in2" +cat < mcomm-test6.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test6.in2 +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +tmpfiles="$tmpfiles mcomm-test6.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 --no-location -o mcomm-test6.out \ + mcomm-test6.in1 mcomm-test6.in2 + +tmpfiles="$tmpfiles mcomm-test6.ok" +cat << EOF > mcomm-test6.ok +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +msgid "1" +msgstr "1x" + +msgid "2" +msgstr "2x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test6.ok mcomm-test6.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-7 b/tests/msgcomm-7 new file mode 100755 index 000000000..42453ddd8 --- /dev/null +++ b/tests/msgcomm-7 @@ -0,0 +1,52 @@ +#! /bin/sh + +# Test --no-location and --omit-header options together. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test7.in1 mcomm-test7.in2" +cat < mcomm-test7.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test7.in2 +#: hunt.c:759 +msgid "2" +msgstr "2x" +EOF + +tmpfiles="$tmpfiles mcomm-test7.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=0 --no-location --omit-header -o mcomm-test7.out \ + mcomm-test7.in1 mcomm-test7.in2 + +tmpfiles="$tmpfiles mcomm-test7.ok" +cat << EOF > mcomm-test7.ok +msgid "1" +msgstr "1x" + +msgid "2" +msgstr "2x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test7.ok mcomm-test7.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-8 b/tests/msgcomm-8 new file mode 100755 index 000000000..b5cd32b59 --- /dev/null +++ b/tests/msgcomm-8 @@ -0,0 +1,72 @@ +#! /bin/sh + +# Test merge of common entries with --more-than=1. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test8.in1 mcomm-test8.in2" +cat < mcomm-test8.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test8.in2 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:759 +msgid "1" +msgstr "" +EOF + +tmpfiles="$tmpfiles mcomm-test8.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=1 -o mcomm-test8.out \ + mcomm-test8.in1 mcomm-test8.in2 + +tmpfiles="$tmpfiles mcomm-test8.ok" +cat << EOF > mcomm-test8.ok +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 hunt.c:759 +msgid "1" +msgstr "1x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test8.ok mcomm-test8.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgcomm-9 b/tests/msgcomm-9 new file mode 100755 index 000000000..259db65db --- /dev/null +++ b/tests/msgcomm-9 @@ -0,0 +1,71 @@ +#! /bin/sh + +# Test merge of common entries with --more-than=1 and --no-location. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mcomm-test9.in1 mcomm-test9.in2" +cat < mcomm-test9.in1 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: first.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mcomm-test9.in2 +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: hunt.c:759 +msgid "1" +msgstr "" +EOF + +tmpfiles="$tmpfiles mcomm-test9.out" +: ${MSGCOMM=msgcomm} +${MSGCOMM} --more-than=1 --no-location -o mcomm-test9.out \ + mcomm-test9.in1 mcomm-test9.in2 + +tmpfiles="$tmpfiles mcomm-test9.ok" +cat << EOF > mcomm-test9.ok +msgid "" +msgstr "" +"Project-Id-Version: GNU one 1.2.3\n" +"POT-Creation-Date: 2000-12-11 20:49+0100\n" +"PO-Revision-Date: 2000-03-18 15:25+01:00\n" +"Last-Translator: Karl Eichwalder \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +msgid "1" +msgstr "1x" +EOF + +: ${DIFF=diff} +${DIFF} mcomm-test9.ok mcomm-test9.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgmerge-6 b/tests/msgmerge-6 new file mode 100755 index 000000000..41d328685 --- /dev/null +++ b/tests/msgmerge-6 @@ -0,0 +1,52 @@ +#! /bin/sh + +# Test compendium option. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mm-test6.in1 mm-test6.com mm-test6.pot" +cat < mm-test6.in1 +#: file.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mm-test6.com +#: file.c:345 +msgid "2" +msgstr "2x" +EOF + +cat < mm-test6.pot +#: file.c:123 +msgid "1" +msgstr "" + +#: file.c:345 +msgid "2" +msgstr "" +EOF + +tmpfiles="$tmpfiles mm-test6.out" +: ${MSGMERGE=msgmerge} +${MSGMERGE} -q -C mm-test6.com mm-test6.in1 mm-test6.pot -o mm-test6.out + +tmpfiles="$tmpfiles mm-test6.ok" +cat << EOF > mm-test6.ok +#: file.c:123 +msgid "1" +msgstr "1x" + +#: file.c:345 +msgid "2" +msgstr "2x" +EOF + +: ${DIFF=diff} +${DIFF} mm-test6.ok mm-test6.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgmerge-7 b/tests/msgmerge-7 new file mode 100755 index 000000000..7e7082685 --- /dev/null +++ b/tests/msgmerge-7 @@ -0,0 +1,53 @@ +#! /bin/sh + +# Test compendium option with fuzziness. + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mm-test7.in1 mm-test7.com mm-test7.pot" +cat < mm-test7.in1 +#: file.c:123 +msgid "1" +msgstr "1x" +EOF + +cat < mm-test7.com +#: file.c:345 +msgid "one, two, three" +msgstr "1, 2, 3" +EOF + +cat < mm-test7.pot +#: file.c:123 +msgid "1" +msgstr "" + +#: file.c:345 +msgid "one, two, three..." +msgstr "" +EOF + +tmpfiles="$tmpfiles mm-test7.out" +: ${MSGMERGE=msgmerge} +${MSGMERGE} -q -C mm-test7.com mm-test7.in1 mm-test7.pot -o mm-test7.out + +tmpfiles="$tmpfiles mm-test7.ok" +cat << EOF > mm-test7.ok +#: file.c:123 +msgid "1" +msgstr "1x" + +#: file.c:345 +#, fuzzy +msgid "one, two, three..." +msgstr "1, 2, 3" +EOF + +: ${DIFF=diff} +${DIFF} mm-test7.ok mm-test7.out +result=$? + +# rm -fr $tmpfiles + +exit $result diff --git a/tests/msgmerge-8 b/tests/msgmerge-8 new file mode 100755 index 000000000..897d6c192 --- /dev/null +++ b/tests/msgmerge-8 @@ -0,0 +1,60 @@ +#! /bin/sh + +# Test compendium option. + +# Translation is available within the compendium (mm-test8.com) +# the old translation file (mm-test8.in1) contains the same msgid +# Why not make use of the translation from the compendium? + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mm-test8.in1 mm-test8.com mm-test8.pot" +cat < mm-test8.in1 +#: file.c:123 +msgid "1" +msgstr "1x" + +#: file.c:345 +msgid "one, two, three" +msgstr "" +EOF + +cat < mm-test8.com +#: file.c:345 +msgid "one, two, three" +msgstr "1, 2, 3" +EOF + +cat < mm-test8.pot +#: file.c:123 +msgid "1" +msgstr "" + +#: file.c:345 +msgid "one, two, three" +msgstr "" +EOF + +tmpfiles="$tmpfiles mm-test8.out" +: ${MSGMERGE=msgmerge} +${MSGMERGE} -q -C mm-test8.com mm-test8.in1 mm-test8.pot -o mm-test8.out + +tmpfiles="$tmpfiles mm-test8.ok" +cat << EOF > mm-test8.ok +#: file.c:123 +msgid "1" +msgstr "1x" + +#: file.c:345 +msgid "one, two, three" +msgstr "1, 2, 3" +EOF + +: ${DIFF=diff} +${DIFF} mm-test8.ok mm-test8.out +result=$? + +rm -fr $tmpfiles + +exit $result diff --git a/tests/msgmerge-9 b/tests/msgmerge-9 new file mode 100755 index 000000000..e7e49b47c --- /dev/null +++ b/tests/msgmerge-9 @@ -0,0 +1,100 @@ +#! /bin/sh + +# Test non-ASCII character at the end of msgstr. (Triggered a glibc-2.1 bug.) + +tmpfiles="" +trap 'rm -fr $tmpfiles' 1 2 3 15 + +tmpfiles="mm-test9.in1.po mm-test9.in2.po" +cat < mm-test9.in1.po +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: cog_training 1.0\n" +"POT-Creation-Date: 2001-04-29 22:40+0200\n" +"PO-Revision-Date: 2001-04-29 21:19+02:00\n" +"Last-Translator: Felix Natter \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cogarithmetic.cc:12 cogidmarkup.cc:288 cogroman.cc:14 +msgid "white" +msgstr "weiß" +EOF + +cat < mm-test9.in2.po +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2001-04-30 18:51+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8-bit\n" + +#: cogarithmetic.cc:12 cogidmarkup.cc:288 cogroman.cc:14 +msgid "white" +msgstr "" + +#: cogarithmetic.cc:13 cogroman.cc:109 cogroman.cc:114 +msgid "false." +msgstr "" + +#: cogarithmetic.cc:14 +msgid "was correct." +msgstr "" +EOF + +tmpfiles="$tmpfiles mm-test9.out" +: ${MSGMERGE=msgmerge} +LC_MESSAGES=C LC_ALL= \ +${MSGMERGE} -q mm-test9.in1.po mm-test9.in2.po -o mm-test9.out + +tmpfiles="$tmpfiles mm-test9.ok" +cat < mm-test9.ok +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Free Software Foundation, Inc. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: cog_training 1.0\n" +"POT-Creation-Date: 2001-04-30 18:51+0200\n" +"PO-Revision-Date: 2001-04-29 21:19+02:00\n" +"Last-Translator: Felix Natter \n" +"Language-Team: German \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-1\n" +"Content-Transfer-Encoding: 8bit\n" + +#: cogarithmetic.cc:12 cogidmarkup.cc:288 cogroman.cc:14 +msgid "white" +msgstr "weiß" + +#: cogarithmetic.cc:13 cogroman.cc:109 cogroman.cc:114 +msgid "false." +msgstr "" + +#: cogarithmetic.cc:14 +msgid "was correct." +msgstr "" +EOF + +: ${DIFF=diff} +${DIFF} mm-test9.ok mm-test9.out +result=$? + +rm -fr $tmpfiles + +exit $result